Re: Redundant uses of might_sleep_if()

From: Andrew Morton (akpm_at_osdl.org)
Date: 01/30/04

  • Next message: Patrick Mansfield: "[PATCH] missing export of cpu_2_node"
    Date:	Fri, 30 Jan 2004 12:18:27 -0800
    To: ioana alexandrescu <ioanamitu@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.

    -
    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/


  • Next message: Patrick Mansfield: "[PATCH] missing export of cpu_2_node"

    Relevant Pages

    • Why "PCI: Cannot allocate resource region..."?
      ... I didn't get any response to my previous query, so I figured I'd ask a ... why would the kernel say that it cannot allocate a ... *does* the kernel decide it can't do the allocation? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.0-test2-mm3 and mysql
      ... >> mysql doesn't start on this kernel. ... I am not sure it is a kernel problem. ... There is a cron job doing a query every minute, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 1/3] 2.6.8-rc4-mm1 - Fix UML build
      ... can access them all, and initialized data all before uninitialized, so ... SYMLINKS:= $,$/$f) ... semaphore.c-dir = kernel ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24
      ... > rebooted to a kernel that doesn't have the RT-preempt patch but ... getting a very verbose running trail, almost like an strace output, ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Error mounting root fs on 72:01 using Promise FastTrak TX2000 (PDC20271)
      ... Subject: Error mounting root fs on 72:01 using Promise FastTrak TX2000 ... > Now I'm sucessfully booting my system with the 2.4.23 kernel using ... I think it's when the ATARAID driver is about to fire up. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)