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=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 A3DE5C33C9E for ; Fri, 17 Jan 2020 19:15:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 69C6C2082F for ; Fri, 17 Jan 2020 19:15:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E3Wq5BtI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69C6C2082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F34996B04DF; Fri, 17 Jan 2020 14:15:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE5C76B04E0; Fri, 17 Jan 2020 14:15:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFB926B04E1; Fri, 17 Jan 2020 14:15:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id C547F6B04DF for ; Fri, 17 Jan 2020 14:15:40 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 6E6A54DA4 for ; Fri, 17 Jan 2020 19:15:40 +0000 (UTC) X-FDA: 76388080440.28.vein27_4e8cd3ab71c27 X-HE-Tag: vein27_4e8cd3ab71c27 X-Filterd-Recvd-Size: 6026 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jan 2020 19:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579288539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PWd373jgb9kY1CzqpalVsOK6MHw73NfDBHpCzo4LH3o=; b=E3Wq5BtIqjkb1yNOY2ZXiXDBVUmDF+JfMXrCvDsRmjDx0KjTvP+L650N0dCFXL02XS0f4F Xgq0FEv5t4rFInjsLnS+ODlthCpEkWJ/kSOhInfSwQFHpXsp+njYRc6pAUx9OATU6XY5+8 q3pugm2yo3+CisqKF4xo+O/NsWKhJMc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-ERSaQQgVNGe2iDchkMWuHA-1; Fri, 17 Jan 2020 14:15:37 -0500 Received: by mail-wm1-f71.google.com with SMTP id t4so2629191wmf.2 for ; Fri, 17 Jan 2020 11:15:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=nwe+1XUBl6SaBx9EMqRD4Ccsy9Ue9YSlhzPwxha7bRM=; b=NpCvJFsdfqfjRShDVHNjPCgzOl25ap4MJLSNJ7Ad57dvUFXftktwV3n4Y5wcltT+Ti dQjCo9LlAj55pPkeDlObAGuxwFDu91zk2RaUDGyqFo3U2pfcrHQLoWte6fEJXLCW63ZE 7SzZ9McM3X1/ztK5bVscELEsBEa+5ZkqgN4Ic90zk4fz/kxl8w/bxoM5OqMqvkNqS5iS Y/H4KBGwuz2uKqp/DsTOWby3tUjK6m4dqRg61I8GdmVfU96tCeeh9J6nm8UmxjWqaoyc lZZfB7iteC4HccNKPUOXZFRqJT2HGSnnhJ8UBcswYjV2+j9twI3fCD6cx9UOZyjBTIbm efMg== X-Gm-Message-State: APjAAAWv38JMXrb/bMPOioNkJczzLsuClN8jyTQqDQ5LP9vhZDEun/oP iwLL1HBP7HoCNYv7dkgI1+6+aVCoQBzlCHx8xmNbRiMPO0N41Fohj4/7r3FXn4Mc5fF7XJvfRBl F6K5k0uVHYRI= X-Received: by 2002:a5d:484d:: with SMTP id n13mr4620207wrs.420.1579288536740; Fri, 17 Jan 2020 11:15:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxwcK5zj69WxNnfd1ulvLRRj6Rg1KOev0KYGd681rjTyqgHG+JDs901E1WCSA93e4UAl+j2oA== X-Received: by 2002:a5d:484d:: with SMTP id n13mr4620182wrs.420.1579288536488; Fri, 17 Jan 2020 11:15:36 -0800 (PST) Received: from [192.168.3.122] (p4FF231F7.dip0.t-ipconnect.de. [79.242.49.247]) by smtp.gmail.com with ESMTPSA id f207sm421909wme.9.2020.01.17.11.15.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jan 2020 11:15:35 -0800 (PST) From: David Hildenbrand Mime-Version: 1.0 (1.0) Subject: Re: [PATCH -next v4] mm/hotplug: silence a lockdep splat with printk() Date: Fri, 17 Jan 2020 20:15:34 +0100 Message-Id: <06AE045D-F167-406B-A78B-CAE246058C9D@redhat.com> References: <00155F33-17C6-4051-A8F9-CCD9414F400D@lca.pw> Cc: Michal Hocko , 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 In-Reply-To: <00155F33-17C6-4051-A8F9-CCD9414F400D@lca.pw> To: Qian Cai X-Mailer: iPhone Mail (17C54) X-MC-Unique: ERSaQQgVNGe2iDchkMWuHA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > Am 17.01.2020 um 19:49 schrieb Qian Cai : >=20 > =EF=BB=BF >=20 >> 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. >=20 > Something like this? >=20 > 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) We have a dedicated flag for the offlining part. > + 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. >=20 So, are we fine with unmovable data ending up in ZONE_MOVABLE as long as we= can offline it?=20 This might make my life in virtio-mem a little easier (I can unplug chunks = falling into ZONE_MOVABLE).