Re: [Patch 3/21] Make vma_dump_size() generic

From: Oleg Nesterov
Date: Tue Dec 14 2010 - 11:00:28 EST


Suzuki, I didn't read this series. Still I have some concerns after
the very brief look...

On 12/14, Suzuki K. Poulose wrote:
>
> @@ -114,10 +113,18 @@ unsigned long vma_dump_size(struct vm_ar
> * Switch to the user "segment" for get_user(),
> * then put back what elf_core_dump() had in place.
> */
> - set_fs(USER_DS);
> - if (unlikely(get_user(word, header)))
> - word = 0;
> - set_fs(fs);
> + if (p->group_leader == current->group_leader) {

same_thread_group() ?

> + mm_segment_t fs = get_fs();
> + set_fs(USER_DS);
> + if (unlikely(get_user(word, header)))
> + word = 0;
> + set_fs(fs);
> + } else {
> + int bytes = access_process_vm(p, (unsigned long)header,
> + &word, sizeof (word), 0);

Well. This adds a little pessimization. It is possible that the
"normal" coredump dumps the CLONE_VM process which doesn't below
to current's thread group.

May be you can compare ->mm's, but I am not sure.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/