From: Andrew Morton <akpm@osdl.org>
To: domen@coderock.org
Cc: linux-kernel@vger.kernel.org, domen@coderock.org,
nacc@us.ibm.com, Patrick Mochel <mochel@digitalimplant.org>,
Greg KH <greg@kroah.com>
Subject: Re: [patch 12/14] drivers/dmapool: use TASK_UNINTERRUPTIBLE instead of TASK_INTERRUPTIBLE
Date: Sun, 6 Mar 2005 19:44:14 -0800 [thread overview]
Message-ID: <20050306194414.68239e90.akpm@osdl.org> (raw)
In-Reply-To: <20050306223654.3EE871EC90@trashy.coderock.org>
domen@coderock.org wrote:
>
> use TASK_UNINTERRUPTIBLE instead of TASK_INTERRUPTIBLE
>
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> Signed-off-by: Domen Puncer <domen@coderock.org>
> ---
>
>
> kj-domen/drivers/base/dmapool.c | 2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
> diff -puN drivers/base/dmapool.c~task_unint-drivers_base_dmapool drivers/base/dmapool.c
> --- kj/drivers/base/dmapool.c~task_unint-drivers_base_dmapool 2005-03-05 16:11:21.000000000 +0100
> +++ kj-domen/drivers/base/dmapool.c 2005-03-05 16:11:21.000000000 +0100
> @@ -293,7 +293,7 @@ restart:
> if (mem_flags & __GFP_WAIT) {
> DECLARE_WAITQUEUE (wait, current);
>
> - current->state = TASK_INTERRUPTIBLE;
> + set_current_state(TASK_UNINTERRUPTIBLE);
> add_wait_queue (&pool->waitq, &wait);
> spin_unlock_irqrestore (&pool->lock, flags);
This code is alread a bit odd. If we're prepared to sleep in there, then
why use GFP_ATOMIC?
If it is so that we can dig a bit deeper into the free page pools then
something like __GFP_WAIT|__GFP_HIGH would be preferable.
And why isn't mem_flags passed into pool_alloc_page() verbatim?
I agree on the TASK_UNINTERRUPTIBLE change: if the calling task happens to
have signal_pending() then the schedule_timeout() will fall right through.
Why should we change kernel memory allocation strategy if the user hit ^C?
Also, __set_current_state() can be user here: the add_wait_queue() contains
the necessary barriers. (Grubby, but we do that in quite a few places with
this particular code sequence (we should have an add_wait_queue() variant
which does the add_wait_queue+__set_current_state all in one hit (but let's
not, else I'll be buried in another 1000 cleanuplets))).
next prev parent reply other threads:[~2005-03-07 3:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-06 22:36 [patch 12/14] drivers/dmapool: use TASK_UNINTERRUPTIBLE instead of TASK_INTERRUPTIBLE domen
2005-03-07 3:44 ` Andrew Morton [this message]
2005-03-07 5:01 ` Nish Aravamudan
2005-03-07 5:31 ` Andrew Morton
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=20050306194414.68239e90.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=domen@coderock.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.org \
--cc=nacc@us.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