Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp968985ybp; Fri, 4 Oct 2019 07:43:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1t9IPSRYU574M9mhHa0/4fSDjhVZrYcF2f70wUgwnfilohXKyrRAoeBBczuYLVII6lBZU X-Received: by 2002:a17:906:441:: with SMTP id e1mr12833708eja.166.1570200212422; Fri, 04 Oct 2019 07:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570200212; cv=none; d=google.com; s=arc-20160816; b=oEDadQp3qZMgn7XAmwQ9LKUWEukPLHqZ+C5npsFtiJmvTDsgZi9E4dZX+RgxEHTjyq TKvBcEXV6e1WIeWGsDynK/IckVyBvAXpNZie4IPiREaWQYSuq70jrft/zfeeYeka/hG2 jLPhJN+8ei+8XieVOQ4kgI2ntQmullWYZ7SqUGhS+WgRr4+PbBYXMSHiYhltCcdOTlbz b3V20nTcWSRzDpPfsJCb/KiYzVl0Sf6fiV7ssb7s5AYyhgbWVCjdzAC28qnJIHTYb0ag HIPrK8OsELCQcqfqc2P2EwkfGorzY/mk9BXG3tMBjyA862Iq1KjmaGm+iiCjFLgN2Ihd X4ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Egi8keaYTtTblwlYL/IJci58RzPM6no3Atq6ou/NbUo=; b=NXyG73O4yShSd18ygWodfuGWbQrkPbnGUOfojs3RpFqsS3LM/JohIiivLhh4QxjvLh i9M7NzD5NqMov8rGc6jeD40/Y168HdAK3bVrm54EWYwAO01eh8f9zVXCh/Ro5KY7X6OZ ZhCLVXYKpstkhUPBWJxWv1azzYmPismzGLE4XTq6onm5H1Adnx9CA17VD2PGBzStoLDB jDfB5iUALPo3wdbCp/UA7BnxSOO5uXwj7bcOzfwptv9aAJpXVZb8LougUemtSF22swOu FxEep8DTx5FTsl/S4ynjhojptOrBUvL9w4O+PL5KkcF60B8wmoPgLiVdShIKsxKNw2Wx 4s6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si3687291edr.187.2019.10.04.07.43.07; Fri, 04 Oct 2019 07:43:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389107AbfJDOly (ORCPT + 99 others); Fri, 4 Oct 2019 10:41:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:48480 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388733AbfJDOlx (ORCPT ); Fri, 4 Oct 2019 10:41:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D7730AC69; Fri, 4 Oct 2019 14:41:51 +0000 (UTC) Date: Fri, 4 Oct 2019 16:41:50 +0200 From: Michal Hocko To: Qian Cai 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 Subject: Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages() Message-ID: <20191004144150.GO9578@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> <1570197360.5576.275.camel@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1570197360.5576.275.camel@lca.pw> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 04-10-19 09:56:00, Qian Cai wrote: > 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. So this is not as much a hotplug specific problem but zone->lock -> printk -> alloc chain that is a problem, right? Who is doing an allocation from this atomic context? I do not see any atomic allocation in kernel/printk/printk.c. -- Michal Hocko SUSE Labs