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_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 6D452C4727E for ; Wed, 7 Oct 2020 22:00:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B98E22204 for ; Wed, 7 Oct 2020 22:00:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="Ncyj5HRy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B98E22204 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DFA788E0005; Wed, 7 Oct 2020 18:00:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D83688E0001; Wed, 7 Oct 2020 18:00:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C49988E0005; Wed, 7 Oct 2020 18:00:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 9519D8E0001 for ; Wed, 7 Oct 2020 18:00:13 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 24887824999B for ; Wed, 7 Oct 2020 22:00:13 +0000 (UTC) X-FDA: 77346498306.05.moon99_4f07582271d2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 068A31801753F for ; Wed, 7 Oct 2020 22:00:12 +0000 (UTC) X-HE-Tag: moon99_4f07582271d2 X-Filterd-Recvd-Size: 4169 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Wed, 7 Oct 2020 22:00:12 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id lw21so5126944ejb.6 for ; Wed, 07 Oct 2020 15:00:11 -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=QuOC4Xua/e8RyCipakI2ERzr4JfnD5Uun81ZVOwlretVh3FgE4po/SsidViDXdYdbB fwjMUNXnAapkxEUj6xXcAZQxePEYoXlANngEiV09hfg6JHW8w/hge2Vg6pd1oxVfkjlC xBu7iv4QhFH0W32Vx8imsQsddlkG8hqNHGX0uCf2xvl/ng3dojDLJe5S68i4vTiqDkkv pj5771O4DB+/r25GmqjhDUSinOWgfL71cQcFz4pDTvdpD6SJ6/Ywck9Mg4pfqjVOI7BL Jx1yCohoVmUQUqwK2hO7sO2pDTyRg4Hovo9ovkLVIfEsQIHKyK78WwUf2LVI8uCuoQDs N5Vg== X-Gm-Message-State: AOAM530VRZPuVLMkeTUXxaVCX+Uku1NuLnXfRFkavaVTfqOrJIjFjzE/ 0Qe8rWq55q6mdsICXZ/l47PueuY+PiB37h6S0ZJySQ== X-Google-Smtp-Source: ABdhPJwku5mxYKwAyqqbDYZNawCeRw0Upn7X7sfFjzI/V4bf8n3ZT6QOAaXMTZWtxx4JzYTkY6EwLAJYedQOql+eTOc= 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" 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 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.