From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B489C10F14 for ; Thu, 10 Oct 2019 14:47:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 296B1206A1 for ; Thu, 10 Oct 2019 14:47:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="miW/7gsG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 296B1206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AD3A28E0003; Thu, 10 Oct 2019 10:47:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A85506B0005; Thu, 10 Oct 2019 10:47:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 972218E0003; Thu, 10 Oct 2019 10:47:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 719426B0003 for ; Thu, 10 Oct 2019 10:47:43 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 0B5568243763 for ; Thu, 10 Oct 2019 14:47:43 +0000 (UTC) X-FDA: 76028154006.09.tiger07_7d82c66671111 X-HE-Tag: tiger07_7d82c66671111 X-Filterd-Recvd-Size: 5256 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 10 Oct 2019 14:47:42 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id z67so5803895qkb.12 for ; Thu, 10 Oct 2019 07:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=dY3cxBFbn5BFQR3wtmZXnj2xekyjm05rgtTqVfByDnk=; b=miW/7gsGehxbucNWUNf+JQQBZuBtJ2eE0qM4yM0DCDw4cxXTcso32P45cl8wkFq2aV QiAzEX8SfUjgqSnOp3xq9j/NJYHOlrYkv0vzUZ2SiNP/GRVGUpnKcCBh7bRerWjIlGfw f9hLXoCL2l9oLKJ8nNLr3d9TVtxohQRIk65qwUMO2cUWjc2AlMt4bULOYdg5daeZYvGi fb7rVgBALWWubKCC0Hh4ezsT0yQl2avWYlBCFlUTGabe0tkEO6snRU6NDw1vg8ebTLSO XqJOybJAHXF+aNu2td0emR0oOpgjJ28ENqxR8D6ivWvfSXcamA1hqcD5DogH1QcRwuhZ MQWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=dY3cxBFbn5BFQR3wtmZXnj2xekyjm05rgtTqVfByDnk=; b=q5pAaSfjNt+F1Ledcl3mtTz9x6vM5rhs46P0HxJxOjSgDyjyKByR5q/RPJcRpTdQd5 tsbSCN+CuUPofW5nUfmmxgGMt0ZFIrezSdcTppFjYBJeOT/82WtIgOf6J2Ks9LZJaVbZ LUbylTWnb5oBpqI+hTRepatvTZ1Lbiy0bgbZD7RryuVWl3OtxcKnfRxALdMewsCe3ywn giaYJDyE5UoKFrbhIwCx9RHTqDEusbLVljrpF/Q0Cn1ICr/gB+aDc5GGZLwprqQgz1+v NaQmu4BAkrnn/QJrdzLjy5zhexZGAHr/Y25GbDsXiFjnlAHXZqoOVl6yc8lmOqeb+87g JXrg== X-Gm-Message-State: APjAAAWeciSnXV+sET4acEhwElGwsxMYgQeZl2dD+VsfovJPeXpPysdP 2VmM+lq7LnpL7RM44Jd6U8363w== X-Google-Smtp-Source: APXvYqzuGVYLmfVHrpebW8KExt+KSlXKe3bxkKadjMlG+hrolzAg5Lm0HAeVpSLnhiERXxK/ZtkJ6w== X-Received: by 2002:a37:9847:: with SMTP id a68mr10359301qke.223.1570718861606; Thu, 10 Oct 2019 07:47:41 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id f27sm2366449qkh.42.2019.10.10.07.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Oct 2019 07:47:40 -0700 (PDT) Message-ID: <1570718858.5937.28.camel@lca.pw> Subject: Re: [PATCH v2] mm/page_isolation: fix a deadlock with printk() From: Qian Cai To: Michal Hocko Cc: Petr Mladek , Christian Borntraeger , Heiko Carstens , sergey.senozhatsky.work@gmail.com, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, john.ogness@linutronix.de, akpm@linux-foundation.org, Vasily Gorbik , Peter Oberparleiter , david@redhat.com, linux-kernel@vger.kernel.org Date: Thu, 10 Oct 2019 10:47:38 -0400 In-Reply-To: <20191010141820.GI18412@dhcp22.suse.cz> References: <20191009162339.GI6681@dhcp22.suse.cz> <6AAB77B5-092B-43E3-9F4B-0385DE1890D9@lca.pw> <20191010105927.GG18412@dhcp22.suse.cz> <1570713112.5937.26.camel@lca.pw> <20191010141820.GI18412@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 2019-10-10 at 16:18 +0200, Michal Hocko wrote: > On Thu 10-10-19 09:11:52, Qian Cai wrote: > > On Thu, 2019-10-10 at 12:59 +0200, Michal Hocko wrote: > > > On Thu 10-10-19 05:01:44, Qian Cai wrote: > > > >=20 > > > >=20 > > > > > On Oct 9, 2019, at 12:23 PM, Michal Hocko w= rote: > > > > >=20 > > > > > If this was only about the memory offline code then I would agr= ee. But > > > > > we are talking about any printk from the zone->lock context and= that is > > > > > a bigger deal. Besides that it is quite natural that the printk= code > > > > > should be more universal and allow to be also called from the M= M > > > > > contexts as much as possible. If there is any really strong rea= son this > > > > > is not possible then it should be documented at least. > > > >=20 > > > > Where is the best place to document this? I am thinking about und= er > > > > the =E2=80=9Cstruct zone=E2=80=9D definition=E2=80=99s lock field= in mmzone.h. > > >=20 > > > I am not sure TBH and I do not think we have reached the state wher= e > > > this would be the only way forward. > >=20 > > How about I revised the changelog to focus on memory offline rather t= han making > > a rule that nobody should call printk() with zone->lock held? >=20 > If you are to remove the CONFIG_DEBUG_VM printk then I am all for it. I > am still not convinced that fiddling with dump_page in the isolation > code is justified though. No, dump_page() there has to be fixed together for memory offline to be u= seful. What's the other options it has here? By not holding zone->lock in dump_p= age() from set_migratetype_isolate(), it even has a good side-effect to increas= e the system throughput as dump_page() could be time-consuming. It may make the= code a bit cleaner by introducing a has_unmovable_pages_locked() version.