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=-6.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 EA18DC433DF for ; Fri, 14 Aug 2020 13:35:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A51322068E for ; Fri, 14 Aug 2020 13:35:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="QWANU76u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A51322068E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2C2C56B0007; Fri, 14 Aug 2020 09:35:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 272BE6B0008; Fri, 14 Aug 2020 09:35:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1894A6B000A; Fri, 14 Aug 2020 09:35:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 0301E6B0007 for ; Fri, 14 Aug 2020 09:35:49 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A9C411E01 for ; Fri, 14 Aug 2020 13:35:49 +0000 (UTC) X-FDA: 77149272018.23.bike48_2407f7526ffd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 7A65B37612 for ; Fri, 14 Aug 2020 13:35:49 +0000 (UTC) X-HE-Tag: bike48_2407f7526ffd X-Filterd-Recvd-Size: 6038 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Aug 2020 13:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1597412149; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=Vhg2qIv0Jz5uNB1to7SsFv5hNsQzCGoy7ntsgX816ME=; b=QWANU76u6vvTAppbeE3oiaCtswKBEsZvtwLwDhtEvXPR9vVJToyEqHa/ 78ytLWE8vSLHhWguSrRZ0hzkp8llVI4UFIZuu9xAK5nV+UZnNh6M9ip7d wsUZV3Pa2eoOZypRY6OmW5C4jQsUXPIK8Gox2NsagM7x64AFcqUOcaE24 k=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 3kOFJD7N60ERtsB74qGJI3XB6PL0hrH37iAm0pbM5PNV/FQ6T6jmbeXASasblAXIeXQLqwqf0n B/Da4GKHV9G6vOYMwD44IXUGCJ3cYZz2PgjkPj0Fu8FehPYFdfIA/yqX5Wl/Wi5AdwnNtqOBNq 40Ye7b7xVui+0ZvJub15TmF7cyPT3T+Bh7pUD91DG/xaiMgJ/3oxy9ZFN8COrkdaJsAjZEg4WX mmGqnJVZd3jJ/pY7wNa7/8pzAw/ZVX0QKpqU1zHC70psBGvrmWKbneBDww7mnmZg+X4dW6syS7 mIA= X-SBRS: 2.7 X-MesageID: 24880445 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.76,312,1592884800"; d="scan'208";a="24880445" Date: Fri, 14 Aug 2020 15:35:36 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= CC: Christoph Hellwig , , Oleksandr Andrushchenko , David Airlie , Daniel Vetter , Boris Ostrovsky , Stefano Stabellini , Dan Carpenter , Wei Liu , "Yan Yankovskyi" , , , , David Hildenbrand , Michal Hocko , Dan Williams Subject: Re: [PATCH v4 2/2] xen: add helpers to allocate unpopulated memory Message-ID: <20200814133536.GL975@Air-de-Roger> References: <20200811094447.31208-1-roger.pau@citrix.com> <20200811094447.31208-3-roger.pau@citrix.com> <20200813073337.GA16160@infradead.org> <20200813075420.GC975@Air-de-Roger> <20200814072920.GA6126@infradead.org> <20200814095629.GJ975@Air-de-Roger> <20200814124724.GK975@Air-de-Roger> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 7A65B37612 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: On Fri, Aug 14, 2020 at 02:54:38PM +0200, J=C3=BCrgen Gro=C3=9F wrote: > On 14.08.20 14:47, Roger Pau Monn=C3=A9 wrote: > > On Fri, Aug 14, 2020 at 12:27:32PM +0200, J=C3=BCrgen Gro=C3=9F wrote= : > > > On 14.08.20 11:56, Roger Pau Monn=C3=A9 wrote: > > > > On Fri, Aug 14, 2020 at 08:29:20AM +0100, Christoph Hellwig wrote= : > > > > > On Thu, Aug 13, 2020 at 09:54:20AM +0200, Roger Pau Monn?? wrot= e: > > > > > > On Thu, Aug 13, 2020 at 08:33:37AM +0100, Christoph Hellwig w= rote: > > > > > > > On Tue, Aug 11, 2020 at 11:44:47AM +0200, Roger Pau Monne w= rote: > > > > > > > > If enabled (because ZONE_DEVICE is supported) the usage o= f the new > > > > > > > > functionality untangles Xen balloon and RAM hotplug from = the usage of > > > > > > > > unpopulated physical memory ranges to map foreign pages, = which is the > > > > > > > > correct thing to do in order to avoid mappings of foreign= pages depend > > > > > > > > on memory hotplug. > > > > > > >=20 > > > > > > > So please just select ZONE_DEVICE if this is so much better= rather > > > > > > > than maintaining two variants. > > > > > >=20 > > > > > > We still need to other variant for Arm at least, so both need= to be > > > > > > maintained anyway, even if we force ZONE_DEVICE on x86. > > > > >=20 > > > > > Well, it still really helps reproducability if you stick to one > > > > > implementation of x86. > > > > >=20 > > > > > The alternative would be an explicit config option to opt into = it, > > > > > but just getting a different implementation based on a random > > > > > kernel option is strange. > > > >=20 > > > > Would adding something like the chunk below to the patch be OK? > > > >=20 > > > > ---8<--- > > > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > > > > index 018020b91baa..5f321a1319e6 100644 > > > > --- a/drivers/xen/Kconfig > > > > +++ b/drivers/xen/Kconfig > > > > @@ -328,7 +328,14 @@ config XEN_FRONT_PGDIR_SHBUF > > > > tristate > > > > config XEN_UNPOPULATED_ALLOC > > > > - bool > > > > - default y if ZONE_DEVICE && !ARM && !ARM64 > > > > + bool "Use unpopulated memory ranges for guest mappings" > > > > + depends on X86 > > > > + select ZONE_DEVICE > > > > + default y > > >=20 > > > I'd rather use "default XEN_BACKEND" here, as mappings of other gue= st's > > > memory is rarely used for non-backend guests. > >=20 > > There's also the privcmd and gnt devices which make heavy use of this= , > > so I'm not sure only selecting by default on XEN_BACKEND is the best > > option. >=20 > I just want to avoid that kernels built for running as Xen guest, but > not as dom0, will be forced to select ZONE_DEVICE. >=20 > As privcmd is dom0-only, this is no problem. Oh, didn't know that, I somehow assumed privcmd would be available to all Xen guests regardless of whether dom0 support was selected. > In case you are worrying about gnt devices, I'd be fine to switch to >=20 > default XEN_BACKEND || XEN_GNTDEV Sure. maybe even: default XEN_BACKEND || XEN_GNTDEV || XEN_DOM0 Do you want me to resend with this changed or are you happy to fixup if there are no further comments? Thanks, Roger.