mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Paul Jackson <pj@sgi.com>
Cc: Simon.Derr@bull.net, ak@suse.de, pj@sgi.com,
	linux-kernel@vger.kernel.org, clameter@sgi.com
Subject: Re: [PATCH 6/5] cpuset: rebind numa vma mempolicy fix
Date: Fri, 4 Nov 2005 22:38:10 -0800	[thread overview]
Message-ID: <20051104223810.31355dce.akpm@osdl.org> (raw)
In-Reply-To: <20051104082833.8786.5266.sendpatchset@jackhammer.engr.sgi.com>

Paul Jackson <pj@sgi.com> 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.

      reply	other threads:[~2005-11-05  6:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04  8:28 Paul Jackson
2005-11-05  6:38 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051104223810.31355dce.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=Simon.Derr@bull.net \
    --cc=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®