Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9373270ybl; Fri, 17 Jan 2020 10:51:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyF2CxB50iFjhLN+ZwVx8pWS3y/Exc/uHjoR1gmwoAWHl/UvZb6E7G1wOpLXJG2TcFS7wbf X-Received: by 2002:a05:6830:2057:: with SMTP id f23mr7313125otp.110.1579287080838; Fri, 17 Jan 2020 10:51:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579287080; cv=none; d=google.com; s=arc-20160816; b=KZ9j+flcmbRJVIqvVssWDR8gLsZ4avHCxDr2jT3J7bNsMlA3PoYRusJlMxCozdR9ZA DpigrkR+E2oEY6aKZD1dmvMA884Ea4r6MojVi+lFB4LbENpdnoZ8OPTwFIPuUyIocf9s 6kBOlJcJZ/yPzjtiKHx6uOa7rJ1XGgTAm93DoJfXbtJDOvzErVRim5hmuchoNd+/T63+ 5yAAVlghHWgzmHVUgmH/DM1eg8lHYtCwcginuD7rgAv2JUDgrPXdCnEPyMIuvuEK2XHF HO/UyQ0Sndzh/Cw5Twg9SPQ/an4R8f8MMfQ4jSEQZInb10GOonHNCqdPdEOL5AXe0Cjo ALhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=6zf6EUsnzoIFH8F/2Csfpg9qeASx8BfPLWtgpgM5e18=; b=xjUGk3oQ1oEI7vM0J0qQCNkE33dZWmENoDp0Td0J0XH/gzzwuZENByqsiqwplGdvab lyuBSEsECfuP/mOINn/xTjsqiaJnfWYDgeMufw7qtCHemTcrB/U87RXcNBwsbE2VLEUc nRVWQW+WUK4n+PlQSb2bnlCTRybfaD2yrhHBp1QfyKvgE8WWQrGF3pSU1Bd3Fo7inwvw /QB98M/pvOyk9WWIaSGaR+eAtljhBwK8LIFIehV5j8w3SmbqvGy/FuDx49WXS7jMfiwm 0tUe8tLTUQUFV6yEOFFHNiEDcA0HEn8iB3CDZr84uJadPfKrEVMG3LHAO8byctKx4paa 5QVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b="T/YKvKzX"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e190si14429868oib.113.2020.01.17.10.51.07; Fri, 17 Jan 2020 10:51:20 -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; dkim=pass header.i=@lca.pw header.s=google header.b="T/YKvKzX"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729123AbgAQSt4 (ORCPT + 99 others); Fri, 17 Jan 2020 13:49:56 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45210 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbgAQSt4 (ORCPT ); Fri, 17 Jan 2020 13:49:56 -0500 Received: by mail-qk1-f193.google.com with SMTP id x1so23632941qkl.12 for ; Fri, 17 Jan 2020 10:49:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6zf6EUsnzoIFH8F/2Csfpg9qeASx8BfPLWtgpgM5e18=; b=T/YKvKzXDojfWpYDzivY7tCKgOF5Zy+3O774FxFwAAfINGHOO9/tyfMxOL/8qJYBQH D53UC7QEgREt2UgsAwquUt6IlJN66SYSyIDO1tem0vWvJz+zMeAC7nZD1NhWaabWatqC 37tbpXkgjFDInuVsoo882bmAsx4AelhB+JzKIE3t6knbcrfD9UPm9iRoj2XLGu71wJxH dUAPBJ25W12fCMoyefGRPIibkDTwS+9mtoJ4PTNwqgsVWZh76rMdbw+4B9IUdrGVpVQJ 2diyw/woaKzXFOS6Glt3Bhjevmljvw9xLifxBJy9GCyJeXwqJxSu2duqtkEUToNmI7Mx dY4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6zf6EUsnzoIFH8F/2Csfpg9qeASx8BfPLWtgpgM5e18=; b=VTYH8TGTal2w/q0jhcZ8T11ugWgDh+sADPgzzK3L3tzIuB6A2/mw8Jc2vTve/tXFhM xzMb+xIVg5CwfRhN3HNN13JbRHwOfUF6wRid6YNZp/v40Ses+SEEeMWt49s/tWVfrC6c kby15ABCglVcVE69xNK7UBHjcF9DRBSguLMtL6ZnENmD5sL6XWiTytHrzirKyT+TSumc 4NZmAHmS8XsmkyW7OftB4Eji/0H3mpuHqO26xSI4ChP8okI6yeuNqBUcgzCt1Bd7AS2f axnTcdYrbdLO/mjTqEjcv2W06WtcZxZmhE5TKNlynXKwrcRc9/vOYlBiaYwHRsDmDnNb fTEg== X-Gm-Message-State: APjAAAV+l1h7CUSIoRGB0KA1LtwBZobvTxox/GYpPv11jqU0AYRnhvCn yvG47wRfhLkx7KLX7+rWDPvvLA== X-Received: by 2002:a37:644:: with SMTP id 65mr39957548qkg.309.1579286995335; Fri, 17 Jan 2020 10:49:55 -0800 (PST) Received: from [192.168.1.153] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id m27sm13585570qta.21.2020.01.17.10.49.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jan 2020 10:49:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: [PATCH -next v4] mm/hotplug: silence a lockdep splat with printk() From: Qian Cai In-Reply-To: <20200117154657.GL19428@dhcp22.suse.cz> Date: Fri, 17 Jan 2020 13:49:53 -0500 Cc: Andrew Morton , Sergey Senozhatsky , pmladek@suse.com, rostedt@goodmis.org, peterz@infradead.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <00155F33-17C6-4051-A8F9-CCD9414F400D@lca.pw> References: <20200117143905.GZ19428@dhcp22.suse.cz> <3B7490FB-E915-4DC7-8739-01EDC023E22E@lca.pw> <20200117154657.GL19428@dhcp22.suse.cz> To: Michal Hocko X-Mailer: Apple Mail (2.3608.40.2.2.4) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 17, 2020, at 10:46 AM, Michal Hocko wrote: >=20 > On Fri 17-01-20 10:05:12, Qian Cai wrote: >>=20 >>=20 >>> On Jan 17, 2020, at 9:39 AM, Michal Hocko wrote: >>>=20 >>> Thanks a lot. Having it in a separate patch would be great. >>=20 >> I was thinking about removing that WARN together in this v5 patch, >> so there is less churn to touch the same function again. However, I >> am fine either way, so just shout out if you feel strongly towards a >> separate patch. >=20 > I hope you meant moving rather than removing ;). The warning is useful > because we shouldn't see unmovable pages in the movable zone. And a > separate patch makes more sense because the justification is slightly > different. We do not want to have a way for userspace to trigger the > warning from userspace - even though it shouldn't be possible, but > still. Only the offlining path should complain. Something like this? diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 621716a25639..32c854851e1f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8307,7 +8307,6 @@ struct page *has_unmovable_pages(struct zone = *zone, struct page *page, } return NULL; unmovable: - WARN_ON_ONCE(zone_idx(zone) =3D=3D ZONE_MOVABLE); return pfn_to_page(pfn + iter); } =20 diff --git a/mm/page_isolation.c b/mm/page_isolation.c index e70586523ca3..08571b515d9f 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -54,9 +54,11 @@ static int set_migratetype_isolate(struct page *page, = int migratetype, int isol_ =20 out: spin_unlock_irqrestore(&zone->lock, flags); + if (!ret) drain_all_pages(zone); else if ((isol_flags & REPORT_FAILURE) && unmovable) + WARN_ON_ONCE(zone_idx(zone) =3D=3D ZONE_MOVABLE); /* * printk() with zone->lock held will guarantee to = trigger a * lockdep splat, so defer it here.=