Re: [PATCH] set_pgdat_percpu_threshold() don't use for_each_online_cpu

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Tuesday, November 16, 2010 - 5:07 pm

On Sun, 14 Nov 2010 17:53:03 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:


Well what's actually happening here?  Where is the alleged deadlock?

In the kernel_init() case we have a GFP_KERNEL allocation inside
get_online_cpus().  In the other case we simply have kswapd calling
get_online_cpus(), yes?

Does lockdep consider all kswapd actions to be "in reclaim context"? 
If so, why?


Well.  Being able to run for_each_online_cpu() is a pretty low-level
and fundamental thing.  It's something we're likely to want to do more
and more of as time passes.  It seems a bad thing to tell ourselves
that we cannot use it in reclaim context.  That blots out large chunks
of filesystem and IO-layer code as well!


That's a pretty sad change IMO, especially of num_possible_cpus is much
larger than num_online_cpus.

What do we need to do to make get_online_cpus() safe to use in reclaim
context?  (And in kswapd context, if that's really equivalent to
"reclaim context").
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 2/2] mm: vmstat: Use a single setter function a ..., Christoph Lameter, (Wed Oct 27, 1:13 pm)
Re: [PATCH 1/2] mm: page allocator: Adjust the per-cpu cou ..., Christoph Lameter, (Wed Oct 27, 1:16 pm)
Re: [PATCH 1/2] mm: page allocator: Adjust the per-cpu cou ..., KAMEZAWA Hiroyuki, (Wed Oct 27, 6:09 pm)
Re: [PATCH 2/2] mm: vmstat: Use a single setter function a ..., KAMEZAWA Hiroyuki, (Wed Oct 27, 6:10 pm)
Re: [PATCH 1/2] mm: page allocator: Adjust the per-cpu cou ..., KAMEZAWA Hiroyuki, (Thu Oct 28, 2:58 am)
Re: [PATCH] set_pgdat_percpu_threshold() don't use for_eac ..., Christoph Lameter, (Mon Nov 15, 7:04 am)
Re: [PATCH] set_pgdat_percpu_threshold() don't use for_eac ..., Andrew Morton, (Tue Nov 16, 5:07 pm)
Re: [PATCH] set_pgdat_percpu_threshold() don't use for_eac ..., Christoph Lameter, (Fri Nov 19, 8:29 am)