From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id F3C386B0007 for ; Mon, 19 Mar 2018 06:45:30 -0400 (EDT) Received: by mail-wr0-f200.google.com with SMTP id 96so9085109wrk.12 for ; Mon, 19 Mar 2018 03:45:30 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b36sor18668edd.11.2018.03.19.03.45.29 for (Google Transport Security); Mon, 19 Mar 2018 03:45:29 -0700 (PDT) Date: Mon, 19 Mar 2018 13:45:02 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2] mm: Warn on lock_page() from reclaim context. Message-ID: <20180319104502.n524uvuvjze3hbdz@node.shutemov.name> References: <1521295866-9670-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <20180317155437.pcbeigeivn4a23gt@node.shutemov.name> <201803181022.IAI30275.JOFOQMtFSHLFOV@I-love.SAKURA.ne.jp> <20180319090419.GR23100@dhcp22.suse.cz> <20180319101440.6xe5ixd5nn4zrvl2@node.shutemov.name> <20180319103336.GU23100@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180319103336.GU23100@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Tetsuo Handa , akpm@linux-foundation.org, linux-mm@kvack.org, kirill.shutemov@linux.intel.com On Mon, Mar 19, 2018 at 11:33:36AM +0100, Michal Hocko wrote: > On Mon 19-03-18 13:14:40, Kirill A. Shutemov wrote: > > On Mon, Mar 19, 2018 at 10:04:19AM +0100, Michal Hocko wrote: > > > On Sun 18-03-18 10:22:49, Tetsuo Handa wrote: > > > > >From f43b8ca61b76f9a19c13f6bf42b27fad9554afc0 Mon Sep 17 00:00:00 2001 > > > > From: Tetsuo Handa > > > > Date: Sun, 18 Mar 2018 10:18:01 +0900 > > > > Subject: [PATCH v2] mm: Warn on lock_page() from reclaim context. > > > > > > > > Kirill A. Shutemov noticed that calling lock_page[_killable]() from > > > > reclaim context might cause deadlock. In order to help finding such > > > > lock_page[_killable]() users (including out of tree users), this patch > > > > emits warning messages when CONFIG_PROVE_LOCKING is enabled. > > > > > > So how do you ensure that this won't cause false possitives? E.g. do we > > > ever allocate while holding the page lock and not having the page on the > > > LRU list? > > > > Hm. Do we even have a reason to lock such pages? > > Probably we do, but I cannot come up with an example. > > Page lock is way too obscure to be sure :/ > Anyway, maybe we want to be more conservative and only warn about LRU > pages... I would rather see what we actually step onto. Sometimes false-positive warning may bring useful insight. Maybe keep in in mm- tree for few cycles? (If it wouldn't blow up immediately) -- Kirill A. Shutemov