Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp745841pxu; Wed, 7 Oct 2020 15:02:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycAONaNOwYo3jcg7oKd8Rof9aB2FGFaWBvQQ8zw04JKCbpipqJRNYillkSiJfgR60U2h9X X-Received: by 2002:a17:906:f90a:: with SMTP id lc10mr5653517ejb.272.1602108148673; Wed, 07 Oct 2020 15:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602108148; cv=none; d=google.com; s=arc-20160816; b=1Kuhx6Vu8JI5GpWDtv453JO3eZHuyUYL8+WYv9tz33TXTD7uvxeGIio4Pj0wOE+W2P bL4Jt3HPY/csXJu3LH4EVdjsPVNeBHDH4mN0Q9QUIenxhrquAQ1bbLeDZUB2J0hG3+9p hSsiu3HbVDIz5HM2k7QeDqJp1AtzIOm9TGfE2j3+DDmo7PKn8SNJRjfCs3yp6bpyuF1i X1+Z2MHNDmUoUvk0wqcLgs74XDuRfXlG2otkM/qIIxBbIQVgbKPi1bXdJ27qCVCOGwUJ V2TIYrM+o94UMMCZgUeKsPhcJ0JRnCMhwsliK3Lw0wiARJeu5O0kzu2+QrSyttARhNEG BGfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lT3B2ypuGco/P409+8M6gpuF12PaIQWc3S2n+DY8zro=; b=xOcXEOAAa2CmdQaHxKvFGID0g9COcJValBnPVj78rMawhsFPc+PUt2A8SIiLdxiXhQ 39XqTIASTC1910CEyULYoCGSDg5Z/zC+WUPLLCCFhlAh2NS0y0maLqXSx3dIbf3Dw2ZK rvoP6W70uj36RbMmajg/O36enwXuX6ICJbTFeEgMy6QnCx4veHQSBJbaQiAm/qprJIZm 4sGKAB3MNMu5Pms5cIbbnshlcVXiigOpIElVU82+l8kOo4Ih6yn5H/vqC/7WNDvaiL2x Oumw7luSELHJKZIpKRFFo5p6IYuQX633aKT/nlU3L81dggYpn8tqZlXb9Pirf9NxJhgy /HZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Ncyj5HRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng6si2355217ejb.81.2020.10.07.15.02.05; Wed, 07 Oct 2020 15:02:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Ncyj5HRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728818AbgJGWAM (ORCPT + 99 others); Wed, 7 Oct 2020 18:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728768AbgJGWAM (ORCPT ); Wed, 7 Oct 2020 18:00:12 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D5D1C0613D3 for ; Wed, 7 Oct 2020 15:00:12 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id c22so5166064ejx.0 for ; Wed, 07 Oct 2020 15:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lT3B2ypuGco/P409+8M6gpuF12PaIQWc3S2n+DY8zro=; b=Ncyj5HRyOHiv/PCCXeiIOREYqhKi9W7Kz+qYVEQlXmRkJQFhr4mPMx/M7DMnm6YtOW DUL/0irEJWJ1u3Tn9PvlSn9dTNsY5IVKDzbC9mmRlGyJusWXyE84FSrRMHnC7+4R/s2K JlmM8UKi1+egfyf0npBB325upNgCiCd5lLpYz+Qt+xyrV5CQrPP3johyniRb8z+kgaE1 GT+P5nqT7wPGuzMyK7J2sXKrVtMSHN7U9uJt8nssAD4vXadYIDhLD2lwmqXOOlH+//Pq Hz5f0mZ598OqpvKpcokOiVFhrrXoK3FDSB6Diw9PKUvJFn/Wdx3dxk6fca3QGoU6OwHC HCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lT3B2ypuGco/P409+8M6gpuF12PaIQWc3S2n+DY8zro=; b=oi7srmR6pTgap1xBRIczQxukPntKMhQFNXB2D7PkMe3RZB/6Mp8z/Wqo6SBlmDqqcI ozA5QPlTDpPRfQ+fwvSWt4HeJlS/lP1QncAOnQlCPsZOoSx62KH6KWcUYMgxw/x965uy cZmgzNvC64idBvW2E07XocRWGVxFwCb6CFPSgPEUt0efLIHFLixMu4QZd/PBtPb8qxHH /oJjFBWMAP1CslLW4pMQQ8Nenye9dRf/wmkNfQHTfHAbEjsjODTlybrywfK5/yf0S7VD N+RJldHGRmJWB7143NdR9WLxLnx0BDAf6tpxsEt3PLLIXJsZyCrYthsGJ02lPFdJvI9f Ehlg== X-Gm-Message-State: AOAM531NzcJbRLMpe3oqO4CNPe14I4kKvJJBfXG+vsyyK4g1YJ0eLrxY A/LxQQOfK6XAw1AIzt4vBqsTazc57XQ5JF04LdOGjQ== X-Received: by 2002:a17:906:4701:: with SMTP id y1mr5413376ejq.341.1602108010723; Wed, 07 Oct 2020 15:00:10 -0700 (PDT) MIME-Version: 1.0 References: <20201006230930.3908-1-rcampbell@nvidia.com> <20201007082517.GC6984@quack2.suse.cz> In-Reply-To: <20201007082517.GC6984@quack2.suse.cz> From: Dan Williams Date: Wed, 7 Oct 2020 14:59:59 -0700 Message-ID: Subject: Re: [PATCH] ext4/xfs: add page refcount helper To: Jan Kara Cc: Ralph Campbell , Linux MM , linux-xfs , linux-fsdevel , linux-nvdimm , Linux Kernel Mailing List , linux-ext4 , Matthew Wilcox , Alexander Viro , "Theodore Ts'o" , Christoph Hellwig , Andreas Dilger , "Darrick J. Wong" , Andrew Morton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 7, 2020 at 1:25 AM Jan Kara wrote: > > On Tue 06-10-20 16:09:30, Ralph Campbell wrote: > > There are several places where ZONE_DEVICE struct pages assume a reference > > count == 1 means the page is idle and free. Instead of open coding this, > > add a helper function to hide this detail. > > > > Signed-off-by: Ralph Campbell > > Reviewed-by: Christoph Hellwig > > Looks as sane direction but if we are going to abstract checks when > ZONE_DEVICE page is idle, we should also update e.g. > mm/swap.c:put_devmap_managed_page() or > mm/gup.c:__unpin_devmap_managed_user_page() (there may be more places like > this but I found at least these two...). Maybe Dan has more thoughts about > this. Yes, but I think that cleanup comes once the idle page count is unified to be 0 across typical and ZONE_DEVICE pages. Then free_devmap_managed_page() can be moved internal to __put_page(). For this patch it's just hiding the "idle == 1" assumption from dax-filesystems.