public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: vatsa@in.ibm.com
Cc: nickpiggin@yahoo.com.au, akpm@osdl.org, mingo@elte.hu,
	suresh.b.siddha@intel.com, hawkes@sgi.com,
	linux-kernel@vger.kernel.org, dino@in.ibm.com
Subject: Re: [PATCH 2.6.16-mm1 1/2] sched_domain: handle kmalloc failure
Date: Sat, 25 Mar 2006 20:10:09 -0800	[thread overview]
Message-ID: <20060325201009.df082c88.pj@sgi.com> (raw)
In-Reply-To: <20060326033838.GB12227@in.ibm.com>

Vatsa wrote:
> I think even if memory allocation fails while making a cpuset exclusive,
> we would still want have the cpuset marked exclusive.

Perhaps ...

The cpuset code itself in the kernel doesn't care at all whether the
dynamic sched domain setup succeeds or not.

If the user or app that made the system call (write '1' to
cpu_exclusive) was setting cpu_exclusive to get a sched domain,
they would want to know if it failed.  If they were looking for one
of the other consequences of an exclusive cpuset, then such an error
is possibly confusing noise.

I keep wishing I had made a separate per-cpuset flag to mark a
cpuset as defining a dynamic sched domain.  Had I done that, I would
definitely want to pass back an error in this case.

But even if the user/app isn't interested in this failure case,
probably the 'good kernel citizen' choice is to report it.  The kernel
should report errors to fail to accomplish requested tasks, and not
second guess whether the user actually cares about that error.

And if we do report an error back to userland, then the request to
set cpuset_exclusive needs to fail entirely, not setting it at all.

So ... bottom line ... when and if it becomes convenient to do so,
have the kernel/sched.c:partition_sched_domains() routine return
an error instead of void.  Then sometime later on, I can change the
cpuset code to pick up that error, unravel the cpu_exclusive setting,
and pass back the error.

But take your sweet time doing this -- no hurry here.

And if you decide it isn't worth the code or effort to do this,
I will gladly forget the whole thing.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

  reply	other threads:[~2006-03-26  4:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25  8:27 [PATCH 2.6.16-mm1 1/2] sched_domain: handle kmalloc failure Srivatsa Vaddagiri
2006-03-26  2:06 ` Andrew Morton
2006-03-26  2:40   ` Srivatsa Vaddagiri
2006-03-26  2:44     ` Andrew Morton
2006-03-26  3:03       ` Nick Piggin
2006-03-26  3:38         ` Srivatsa Vaddagiri
2006-03-26  4:10           ` Paul Jackson [this message]
2006-03-26  3:32       ` Srivatsa Vaddagiri

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=20060325201009.df082c88.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=dino@in.ibm.com \
    --cc=hawkes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=suresh.b.siddha@intel.com \
    --cc=vatsa@in.ibm.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