mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Paul Jackson <pj@sgi.com>
Cc: menage@google.com, miaox@cn.fujitsu.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] cpusets: update tasks' cpus_allowed and mems_allowed after CPU/NODE offline/online
Date: Wed, 4 Jun 2008 13:02:43 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.1.10.0806041249390.23189@chino.kir.corp.google.com> (raw)
In-Reply-To: <20080604144221.de09b709.pj@sgi.com>

On Wed, 4 Jun 2008, Paul Jackson wrote:

> How about also adding this check (NULL mm and struct subset cpus)
> to sched_setaffinity?
> 
> Granted, this pair of checks, in cpusets and sched_setaffinity,
> is getting to be a little more work than the PF_* flag.
> 

Yes, an alterative to the PF_CPU_BIND flag is to prevent calls to 
set_cpus_allowed() for kthreads that should not change affinity.

> I guess one question would be how hard we want to work to avoid
> consuming another PF_* flag.  I thought they were scarce, but I
> might be wrong.
> 

I think we both agree that in terms of the code itself, adding the flag 
and doing the check in set_cpus_allowed() is the optimal solution.  It can 
simply return -EINVAL for PF_CPU_BIND threads and the threads don't get 
moved.

It's debatable whether allocating an additional PF_* flag for this purpose 
is worthwhile.

I usually don't advocate against adding such bits that have a clear and 
defined purpose for the sole reason that perhaps later we will need 
additional bits that can't be worked around so easily as this one.  It's 
helpful to be conservative in allocating new flags but not at the expense 
of the code itself, especially when loopholes can easily be introduced 
that would have been otherwise prevented.

So I'll repost the patch and see where it goes.

		David

  reply	other threads:[~2008-06-04 20:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04  2:05 Miao Xie
2008-06-04  9:30 ` Paul Menage
2008-06-04  9:58   ` Paul Menage
2008-06-04 17:22     ` Paul Jackson
2008-06-04 19:01       ` David Rientjes
2008-06-04 19:25         ` Paul Jackson
2008-06-04 19:33           ` David Rientjes
2008-06-04 19:42             ` Paul Jackson
2008-06-04 20:02               ` David Rientjes [this message]
2008-06-04 20:21                 ` Paul Jackson
  -- strict thread matches above, loose matches on Subject: below --
2008-06-02  8:33 Miao Xie

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=alpine.DEB.1.10.0806041249390.23189@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=miaox@cn.fujitsu.com \
    --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®