Redundant uses of might_sleep_if()
From: ioana alexandrescu (ioanamitu_at_yahoo.com)
Date: 01/30/04
- Previous message: Prakash K. Cheemplavam: "Re: khubd crash on scanner disconnect"
- Next in thread: Andrew Morton: "Re: Redundant uses of might_sleep_if()"
- Reply: Andrew Morton: "Re: Redundant uses of might_sleep_if()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 11:40:57 -0800 (PST) To: linux-kernel@vger.kernel.org
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?
Note 1: all present uses of might_sleep_if(cond)
resolve to the equivalent of might_sleep_if(gfp_mask
& __GFP_WAIT) - which suggests an encapsulating
macro:
#define might_sleep_if_wait(flags) might_sleep_if\
(flags & __GFP_WAIT)
Note 2: preliminary analysis suggests that even
cache_alloc_debugcheck_before()-->might_sleep_if()
is, strictly speaking, unnecessary since the same
check in performed in __alloc_pages(). Of course the
duplicated check doesn't cost much.
Carl Spalletta
-- See New Jersey and die! __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Prakash K. Cheemplavam: "Re: khubd crash on scanner disconnect"
- Next in thread: Andrew Morton: "Re: Redundant uses of might_sleep_if()"
- Reply: Andrew Morton: "Re: Redundant uses of might_sleep_if()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Accessing a process structure in the processes link list
... that wasn't compiled with the kernel to access a ... process structure
in the processes link list? ... Meet the all-new My Yahoo! ... send the line "unsubscribe
linux-kernel" in ... (Linux-Kernel) - 2.6-test4: mpspec.h:6:25: mach_mpspec.h: Missing file
... > on a machine booted from a 2.6-test4 kernel, ... > Do you Yahoo!?
... easy-to-use web site design software ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel) - Re: [PATCH] add PCI ROMs to sysfs
... but that kernel is DOA on my machine. ... Win 1 of 4,000 free domain
names from Yahoo! ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - oprofile: profiling kernel
... within the kernel in a certain time interval? ... Mail Mobile ...
Take Yahoo! ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: [PATCH] crypto: resource release functions ought to check for NULL (crypto_free_tfm)
... > longer do the redundant NULL check. ... Below is a patch to do that.
... Please wait until the free_tfm change gets into the kernel and then ... send
the line "unsubscribe linux-kernel" in ... (Linux-Kernel)