[lkml]   [2019]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2] mm/page_isolation: fix a deadlock with printk()
On Mon 07-10-19 07:04:00, Qian Cai wrote:
> > On Oct 7, 2019, at 4:07 AM, Michal Hocko <> wrote:
> >
> > I do not think that removing the printk is the right long term solution.
> > While I do agree that removing the debugging printk __offline_isolated_pages
> > does make sense because it is essentially of a very limited use, this
> > doesn't really solve the underlying problem. There are likely other
> > printks from zone->lock. It would be much more saner to actually
> > disallow consoles to allocate any memory while printk is called from an
> > atomic context.
> No, there is only a handful of places called printk() from
> zone->lock. It is normal that the callers will quietly process
> “struct zone” modification in a short section with zone->lock
> held.

It is extremely error prone to have any zone->lock vs. printk
dependency. I do not want to play an endless whack a mole.

> No, it is not about “allocate any memory while printk is called from an
> atomic context”. It is opposite lock chain from different processors which has the same effect. For example,
> CPU0: CPU1: CPU2:
> console_owner
> sclp_lock
> sclp_lock zone_lock
> zone_lock
> console_owner

Why would sclp_lock ever take a zone->lock (apart from an allocation).
So really if sclp_lock is a lock that might be taken from many contexts
and generate very subtle lock dependencies then it should better be
really careful what it is calling into.

In other words you are trying to fix a wrong end of the problem. Fix the
console to not allocate or depend on MM by other means.
Michal Hocko

 \ /
  Last update: 2019-10-07 13:38    [W:0.213 / U:6.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site