From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org
Subject: Re: Q: semaphore and kmalloc(GFP_KERNEL)?
Date: Mon, 11 May 2009 12:21:40 +0900 (JST) [thread overview]
Message-ID: <20090511122046.B0ED.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <200905110319.n4B3J9hc092830@www262.sakura.ne.jp>
> KOSAKI Motohiro wrote:
> > > Can the kernel detect that we need to let kmalloc() fail and
> > > wake up the writer process so that the writer process releases
> > > the rw_semaphore and reader processes can continue?
> >
> > it can't. Plus it shouldn't.
> > some caller don't want kmalloc() failure.
>
> Thanks.
> Then, should I move kmalloc(GFP_KERNEL) to outside the lock whenever possible?
Yes. almost driver does it.
this is generic issue of nested locking.
> (I worry some lock held by the caller interferes kmalloc(GFP_KERNEL).)
next prev parent reply other threads:[~2009-05-11 3:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 2:30 Tetsuo Handa
2009-05-11 2:56 ` KOSAKI Motohiro
2009-05-11 3:19 ` Tetsuo Handa
2009-05-11 3:21 ` KOSAKI Motohiro [this message]
2009-05-11 3:26 ` Tetsuo Handa
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=20090511122046.B0ED.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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®