Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9397955ybl; Fri, 17 Jan 2020 11:17:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwa6HNuP+kEp2bIVMJU7Cwao6Mh4Oap8aKALJzKJyePi9VPHqBDLAS3SYtIZzhL5fI0SXWT X-Received: by 2002:aca:a811:: with SMTP id r17mr4573578oie.59.1579288640262; Fri, 17 Jan 2020 11:17:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579288640; cv=none; d=google.com; s=arc-20160816; b=yVqK98T8cggZhFUezeZMsGhQX+A5kWDCZFaF5n2O35uFkgx9Z3rjXPx58A+TDQRAbE UP0FffJdBYU4YW9IH7S3S7GnwDNwF+Zqd1VpW2+KPdXneaODxlu1fwUpPoRMNY+9K68c hCkb7mX+BKT79k1qecUyypJ8GhZzq9kxyVfqDo2UTpPCqkF/NPWx+dCJvpyiVviE9DoH YgJ7omjzsCWRMx1jKwKhZN3gUHV5UNy+ifdcRXywnabAHToduOMeP7mOzElqXMBBwMTy TN5Z1TqW6RxQ5buEo7VfMI84G3kL3XsT36ZssNtpuhtXord78hIf6Q7lRcaUd71q2UYi lzRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=nwe+1XUBl6SaBx9EMqRD4Ccsy9Ue9YSlhzPwxha7bRM=; b=ewM9UIb9vW6RHfyG/e1eBh8GlhvBzXWW28ksJPz5+mVybPZMj/Z14+gtea3ocb/FaW wskQLfa73iufeTH364HcgVP7m2mEzA4yVz6htB1g4w3R/v6ttip3y+6B9Xgaw73O0Pu6 WSJH9ehn4QOvewO9LTIhnXyjMo6eQTeMPClUH8qEpp9gxSCy9SrZcpBROeqOTq55FCtO kYVf/jhXAGjEV+nRrvu9DpEdZEzEUzAYUO/SEX2hXFCqBRj5+URvHCJcTdiJhzM8RrZd 1Jn6m9aWbbNlXgE1jwLZwK9+ZNcObx/IIeYTpEjAb2K6y+2xDwAtPjvlWjc9JaN8EPOC 9aDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=buqxbhss; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si15131323otp.70.2020.01.17.11.17.07; Fri, 17 Jan 2020 11:17: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=@redhat.com header.s=mimecast20190719 header.b=buqxbhss; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729439AbgAQTPk (ORCPT + 99 others); Fri, 17 Jan 2020 14:15:40 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47655 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726761AbgAQTPk (ORCPT ); Fri, 17 Jan 2020 14:15:40 -0500 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=nwe+1XUBl6SaBx9EMqRD4Ccsy9Ue9YSlhzPwxha7bRM=; b=buqxbhssQ15Wozl4IrvYh/gl5KeqxkXy+SpPogXY4kKg2Du+C4gZiNSwXBQ5zRWMfYojPo J8BGrRnQr6oxYXDoZv00saN50M9p0/58hSy8DtvHpqhn/Ry87opQFk0BeYebHZwcpwfks6 Or3HG5NoOLt+gY0XYBgF/S6xD6rGPPo= 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-330-nFx3Nvx2MZS7uE2tVtaDpg-1; Fri, 17 Jan 2020 14:15:38 -0500 X-MC-Unique: nFx3Nvx2MZS7uE2tVtaDpg-1 Received: by mail-wm1-f71.google.com with SMTP id b9so2619884wmj.6 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=OAyRM08V3Lx9SONJFn/w1YZlJh0IKNgaTBAtdTcGmv+l+i1q7/eCtoJje9znPISZQZ Bm1mYtOdw+V6eF6CH/yu2nhfUb4HNrFciW5jbf6J/LFUUJjPA1tT1vM6AlbYVcgVCYap BzodrbbxH4s/RltHjdzaDKixCmPVZx+dW1SBDO+ueeynyQMwI0UR6i+G1NRqSIFHGq6P 5VadBaFXbUhjOclYRTORM9KHzgaUMbI1K5hT113O3GgDSWujbayI/Y328QNICA86+9ZL 6JY3WnNoBtHEozXRO/MSJb26LUnxrAIpu3MYYGwHyMbubf0XdqXc4PIPjeYBR4TabolD PXlg== X-Gm-Message-State: APjAAAUGvasxx1GtToJnn3frgs44Sq+gJHXh+MCYR22g0lx1hgJIa1E2 eM25EP9eAPvfIv8qKE8VTIT93OgzU7s42kCcw45XWiw3WQcw/VpkpVfwa6Tpjd7TydijKuNwFS7 9sfkl8+QEfpJwAM0Ksr9F00Lo X-Received: by 2002:a5d:484d:: with SMTP id n13mr4620202wrs.420.1579288536737; Fri, 17 Jan 2020 11:15:36 -0800 (PST) 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) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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, s= truct 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, i= nt 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 c= an offline it?=20 This might make my life in virtio-mem a little easier (I can unplug chunks f= alling into ZONE_MOVABLE).=