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.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 BC28BC47404 for ; Fri, 4 Oct 2019 13:56:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C3D32077B for ; Fri, 4 Oct 2019 13:56:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="PsIURk83" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C3D32077B 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 2689D6B0006; Fri, 4 Oct 2019 09:56:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 240D66B000C; Fri, 4 Oct 2019 09:56:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 130206B000D; Fri, 4 Oct 2019 09:56:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id E45886B0006 for ; Fri, 4 Oct 2019 09:56:04 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 8A14B8243765 for ; Fri, 4 Oct 2019 13:56:04 +0000 (UTC) X-FDA: 76006251048.29.smoke96_34fb47d9d2f06 X-HE-Tag: smoke96_34fb47d9d2f06 X-Filterd-Recvd-Size: 4992 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Oct 2019 13:56:03 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id y144so5837894qkb.7 for ; Fri, 04 Oct 2019 06:56:03 -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=g2Il7BaECJsWIskdenM7M97r0s/NvzNhUCufnwSYYzs=; b=PsIURk83Pa180b008RSqEfoYKXR+bbjKVuxA6hrfm8Px55/gcwWAsuAh+rpSU3nzTM gTkhzm7mpfggtQKmzS0fchLdmPd9ko8elm0j981km/uPdV5rYu4qMaPpqcEHyHOubyry qVMsCOrfNa6xshEdj6HHAw7g76Gu6MmBZAAXr1PJDzlrvc1eQVARTR4oNHg/rkw8uIeO LGxO8X5yCnWW7TsWXOEBuFqrarw7JwFiOVL2DaTcwrIIB3bLH+gbihRBQozv6MstIV2v Xl0EwxPaXKVY4iYAz3kON+MEnOlgSRLhmTZAfp3e/Gz6pflmiQCS519P0J6hjh9fHPFt 3ifA== 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=g2Il7BaECJsWIskdenM7M97r0s/NvzNhUCufnwSYYzs=; b=pGwUfgX9JDRp5JxZqnJZN420VjUKBf6HWdkdhkIy3VFm4BbxvCIyD7U95Iw92GM5J4 iN3xDKpdLPezttMwrnZ8GKuAU0ol/tRkYj6D/LcgiJD/jS4Zuk/TA+A3se1qD38/iqMx Wryr9gYY9i/7lV5Bo+5Nj+YhzK60u0spAgxWLdjw3afaDcX1FYDJztBhAMqUV7EIu/bY B6KNF+jTMJXsovpBTzCEJ7lX+FXVanA/1XVr26QYueZrm+4NXVCwgBdFBU1POXNrvowA Ynze2QAh6wBr1dePiXIqj8iqJfP4sDSlT9Wb5PFGHSEZlJiffSh2TT3oIbQsZQ0WZH80 /tiQ== X-Gm-Message-State: APjAAAWG1reqLVAukwC44G5mHGuOIRNeQMp9QbdDHzMD2O65Z/i8MHBh R02IeVFiNptAH8cty9sA/Z7Xxw== X-Google-Smtp-Source: APXvYqwc0Uf5Q9FcSvf9BpaxQRxiq+AqV3wxA52T62RpEsO8jmlWiy80I4as4DxFRRoKJ92eJBCVhg== X-Received: by 2002:a37:8cc6:: with SMTP id o189mr10362919qkd.82.1570197363305; Fri, 04 Oct 2019 06:56:03 -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 q64sm3453144qkb.32.2019.10.04.06.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Oct 2019 06:56:02 -0700 (PDT) Message-ID: <1570197360.5576.275.camel@lca.pw> Subject: Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() From: Qian Cai To: Michal Hocko Cc: Anshuman Khandual , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org Date: Fri, 04 Oct 2019 09:56:00 -0400 In-Reply-To: <20191004133814.GM9578@dhcp22.suse.cz> References: <1570090257-25001-1-git-send-email-anshuman.khandual@arm.com> <20191004105824.GD9578@dhcp22.suse.cz> <91128b73-9a47-100b-d3de-e83f0b941e9f@arm.com> <1570193776.5576.270.camel@lca.pw> <20191004130713.GK9578@dhcp22.suse.cz> <1570195839.5576.273.camel@lca.pw> <20191004133814.GM9578@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: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 2019-10-04 at 15:38 +0200, Michal Hocko wrote: > On Fri 04-10-19 09:30:39, Qian Cai wrote: > > On Fri, 2019-10-04 at 15:07 +0200, Michal Hocko wrote: > > > On Fri 04-10-19 08:56:16, Qian Cai wrote: > > > [...] > > > > It might be a good time to rethink if it is really a good idea to dump_page() > > > > at all inside has_unmovable_pages(). As it is right now, it is a a potential > > > > deadlock between console vs memory offline. More details are in this thread, > > > > > > > > https://lore.kernel.org/lkml/1568817579.5576.172.camel@lca.pw/ > > > > > > Huh. That would imply we cannot do any printk from that path, no? > > > > Yes, or use something like printk_deferred() > > This is just insane. The hotplug code is in no way special wrt printk. > It is never called from the printk code AFAIK and thus there is no real > reason why this particular code should be any special. Not to mention > it calls printk indirectly from a code that is shared with other code > paths. Basically, printk() while holding the zone_lock will be problematic as console is doing the opposite as it always needs to allocate some memory. Then, it will always find some way to form this chain, console_lock -> * -> zone_lock. > > > or it needs to rework of the current console locking which I have no > > clue yet. > > Yes, if the lockdep is really referring to a real deadlock which I > haven't really explored. >