Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8826534ybl; Fri, 17 Jan 2020 01:41:21 -0800 (PST) X-Google-Smtp-Source: APXvYqx3Pynhvorv4bPA8G3fhl/7fR87G7MbDfbuoSu9do9kGl0z2I+Pb5+g59XmmgvGFGNc3l/M X-Received: by 2002:a54:4713:: with SMTP id k19mr2718514oik.113.1579254081092; Fri, 17 Jan 2020 01:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579254081; cv=none; d=google.com; s=arc-20160816; b=jhYsSfdMjCaq+3T0b3WQMkj7KyB/yFI55rTt4Tc4NLE3vk7ScNN7Tp1eKacMqPOBFq wdSnASZNs3JDXJ5yjR5sOtzJ+2ZYdBA+q0B6f1CspwtFYh8EOTGUqzx8WUdEsWvZYvRx 8i/yoi0Rn8GL3QpKazpVt80CuPyhtjeN9pHenGqdzBuZSF73RvBfW9W20bX9Aa/vt7vo HHWWqPms7YaQfjk2U9ylCFDtXlReiWeeeEeMEjnilGRMMzkpKjnO9W77LkeG15FFUliT 513e0MqWZGrUDG3sZG8+AuDeJvo0gEgQ4gnxo4V/rriCzMdKq1ClIMhGtZ2Ggq+F0coK spGA== 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=tvr1JplSwE1Nh+0Rfwn/I+92DolIasGyNqPK2F8NHJM=; b=EDSzaCGJoKzWvAYTeWlhgrmZl0pWOZPOqe3VNPdL/OdOq2zHbEYbUGWLcTDXZSVAWL w1tCq7kywFcctGDq0bhqxVjORNw1eR/RhGrMtUCFtCGEFwxl4DSPCVGSazNfDg2ikhR7 TwQMfgvaFS8KaSrKWncf+u93dvAR1reBBUWTiTOPuzSFyW2BdJpeB3WC/KjlXYvbdPCE KQgJCMt8wgYow9vxsEVZDOh3cRWxZwkFR649yAzNl/VPZI9OvGBHVS9vMyArCmHGPvk6 9HIpMGot0XXwxJPV8/p+57+qMa8fiP7icSDKpK7tHGGqNEB/wAzDGtcK3oAJsQRephPl 3UUg== 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 d5si11206977otf.198.2020.01.17.01.41.08; Fri, 17 Jan 2020 01:41:21 -0800 (PST) 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 S1726871AbgAQJkN (ORCPT + 99 others); Fri, 17 Jan 2020 04:40:13 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43112 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbgAQJkN (ORCPT ); Fri, 17 Jan 2020 04:40:13 -0500 Received: by mail-wr1-f66.google.com with SMTP id d16so21996307wre.10 for ; Fri, 17 Jan 2020 01:40:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tvr1JplSwE1Nh+0Rfwn/I+92DolIasGyNqPK2F8NHJM=; b=rQHp521l7UxhpsI/SF45+Qmrje2p7XRC528FI9Ch9Ox/2cIwE/ES7oWngtgFJyGruT xbQWdKlOFuS1BY2p5x1oN96xIGgSS0HrKeiuZ+fu1TvWHEJUy/j1cgc5kzwRhujmIcO/ Hj8RCziuftKfqHKiNwZIsu2UljQz9phiSqeTWN4jlLgWydqACjeZgmXUjxU+Ic4ZtwWu HhOcVfYAq52vRdY6l44INveuvx7oKU79gs2RzQvHPLG66ijiBx/+9p/MVpz7z72rpsbp eec7TbFjnaygnbNzwz0NfEbLtQL8rUhc71n7/blj0SGMG6gBYjrVF4EdnenY9go9hZmy aDAQ== X-Gm-Message-State: APjAAAWydu6aZqTKz7njphTjIOoIG7nEK7i4TVD83xFG89ozJLmXn/ei MfWaSQEFt984Kc3dGnTniqs= X-Received: by 2002:a5d:540f:: with SMTP id g15mr2026501wrv.86.1579254011010; Fri, 17 Jan 2020 01:40:11 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id x16sm2876904wmk.35.2020.01.17.01.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 01:40:10 -0800 (PST) Date: Fri, 17 Jan 2020 10:40:09 +0100 From: Michal Hocko To: David Hildenbrand Cc: Qian Cai , akpm@linux-foundation.org, sergey.senozhatsky.work@gmail.com, pmladek@suse.com, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next v4] mm/hotplug: silence a lockdep splat with printk() Message-ID: <20200117094009.GP19428@dhcp22.suse.cz> References: <20200117022111.18807-1-cai@lca.pw> <20200117085932.GK19428@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 17-01-20 10:25:06, David Hildenbrand wrote: > On 17.01.20 09:59, Michal Hocko wrote: > > On Fri 17-01-20 09:51:05, David Hildenbrand wrote: > >> On 17.01.20 03:21, Qian Cai wrote: > > [...] > >>> Even though has_unmovable_pages doesn't hold any reference to the > >>> returned page this should be reasonably safe for the purpose of > >>> reporting the page (dump_page) because it cannot be hotremoved. The > >> > >> This is only true in the context of memory unplug, but not in the > >> context of is_mem_section_removable()-> is_pageblock_removable_nolock(). > > > > Well, the above should hold for that path as well AFAICS. If the page is > > unmovable then a racing hotplug cannot remove it, right? Or do you > > consider a temporary unmovability to be a problem? > > Somebody could test /sys/devices/system/memory/memoryX/removable. While > returning the unmovable page, it could become movable and > offlining+removing could succeed. Doesn't this path use device lock or something? If not than the new code is not more racy then the existing one. Just look at is_pageblock_removable_nolock and how it dereferences struct page (page_zonenum in page_zone.) -- Michal Hocko SUSE Labs