Re: [PATCH 6/5] cpuset: rebind numa vma mempolicy fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Jackson <[email protected]> wrote:
>
> It's ok to not complete the refresh_mems() operation
>  if we notice we are already holding mmap_sem.  We
>  will try again, next time we allocate memory.

What's the call path? alloc_pages_current() and alloc_page_vma()?

> 
>  --- 2.6.14-rc5-mm1-cpuset-patches.orig/kernel/cpuset.c	2005-11-03 21:18:26.783391082 -0800
>  +++ 2.6.14-rc5-mm1-cpuset-patches/kernel/cpuset.c	2005-11-03 23:11:15.480042373 -0800
>  @@ -656,7 +656,12 @@ static void refresh_mems(void)
>   	if (current->cpuset_mems_generation != my_cpusets_mem_gen) {
>   		struct cpuset *cs;
>   		nodemask_t oldmem = current->mems_allowed;
>  +		struct mm_struct *mm = current->mm;
>   
>  +		/* numa_policy_rebind() needs mmap_sem - don't nest */
>  +		if (!mm || !down_write_trylock(&mm->mmap_sem))
>  +			return;
>  +		up_write(&mm->mmap_sem);

What happens if the task is doing _all_ its allocation under
down_read(mmap_sem)?  Like, memset(malloc(lots))?  Does all that memory end
up in the wrong place, or what?

Something less hacky^W^W more deterministic would be nice.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux