mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: ioana alexandrescu <ioanamitu@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Redundant uses of might_sleep_if()
Date: Fri, 30 Jan 2004 12:18:27 -0800	[thread overview]
Message-ID: <20040130121827.11ced639.akpm@osdl.org> (raw)
In-Reply-To: <20040130194057.358.qmail@web60506.mail.yahoo.com>

ioana alexandrescu <ioanamitu@yahoo.com> wrote:
>
> In kernel 2.6.1 it appears that the only necessary
> uses of might_sleep_if()are in __alloc_pages(), and
> perhaps, in cache_alloc_debugcheck_before() (see
> notes).
> 
> Other uses of might_sleep_if() appear to be redundant:
> 
> Pte_chain_alloc()-->might_sleep_if(), but also
> Pte_chain_alloc-->kmem_cache_alloc
>   -->__cache_alloc  -->__cache_alloc()
>   -->cache_alloc_debugcheck_before()
>   -->might_sleep_if()
> 
> skb_share_check()-->might_sleep_if(), but also
> skb_share_check()-->skb_clone()
>   -->kmem_cache_alloc()[as above]
> 
> skb_unshare()-->might_sleep_if(), but also
> skb_unshare()-->skb_copy()
>   -->kmem_cache_alloc()[as above]
> 
> Other paths through skb_unshare, same result.
> 
> 
> QUERY: Should these redundant uses be patched out?

Nope.

Take the case of pte_chain_alloc().  Most of the time, it won't call
kmem_cache_alloc() at all.  But sometimes it will.  But we want to run the
might_sleep() check *every* time someone calls pte_chain_alloc(), not just
some of the times.


      reply	other threads:[~2004-01-30 20:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-30 19:40 ioana alexandrescu
2004-01-30 20:18 ` 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=20040130121827.11ced639.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ioanamitu@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®