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.8 required=3.0 tests=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 CEE0CC43215 for ; Fri, 15 Nov 2019 16:42:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9096420730 for ; Fri, 15 Nov 2019 16:42:08 +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="poDEPVm+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9096420730 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 2CE4E6B000A; Fri, 15 Nov 2019 11:42:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 27F6A6B000C; Fri, 15 Nov 2019 11:42:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BC996B000D; Fri, 15 Nov 2019 11:42:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 10AD16B000A for ; Fri, 15 Nov 2019 11:42:08 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id C0E5B4410 for ; Fri, 15 Nov 2019 16:42:07 +0000 (UTC) X-FDA: 76159079094.03.tree70_12786e35dc830 X-HE-Tag: tree70_12786e35dc830 X-Filterd-Recvd-Size: 4633 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Nov 2019 16:42:06 +0000 (UTC) Received: by mail-oi1-f193.google.com with SMTP id e9so9140206oif.8 for ; Fri, 15 Nov 2019 08:42:06 -0800 (PST) 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:content-transfer-encoding; bh=UZSpFkKNVNV5BKs7QN+kq39SLlJrWMnwXj2a0zo8qnE=; b=poDEPVm+GRR+otLxrdSAZ6RsFhwEqAB1QsJkDuE4KbprEHKb80CHLXH6PlYDj+gCJV aHoGJ3u18gqjviqy7N0LoTBLO0V2sac4WD6sUmk1cxf7Sedhny0n6g52TAzu+xTL5zcX tqsterSsgoqkXQTAK3rkgi24Qnqpvpccy1d9oiLUq5Jl0AXoSygIvE9v68gz5rB1E11H AQNZMSqmOY8G/6aXzE1okGyyRJT0rVFrhEFiY+ce5br0jvhm2hC5K3JKJVYJ547eYn4a fbU3FL4L9qINKtj5J6n+64VjPU/E93yKhOQa2y2aFvCUxcwPs94f7rvsImulrlR+aYaS u5Kw== 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:content-transfer-encoding; bh=UZSpFkKNVNV5BKs7QN+kq39SLlJrWMnwXj2a0zo8qnE=; b=UIkniTWJh6gB9PIL5YsZscHrskKS/68Hyw7DrZBVArcj98sH7Y4xvs//WLwKiMaupi BQSLQhGVrtNgo8V2+78SgXmCVN87m2Zy7Rv+lrmFTloMFk0J1rPiG8ulGmobz62Zjoh9 7qocBtXNrcHQf8DdZMCB/4pRj3b6Z0KWhkz3s0NoLZqtKJ16nX+mOQLz+mvgvRjdLuVH RIREH+ctWSuDbaOXzUSEpNGC6MLqwYqbGRfaDaw7SqgPzV7C9ljFuCbgMCPojj6oay8/ hUwBLY4++WsxlA1Te6MjSIvkNM5BKFGA2RNf1OTQw5fpWtBA3p8KE5Uhv8hBqWekVT1F oOZA== X-Gm-Message-State: APjAAAWbx/E7GFWZOgB5YrYziP/vJJvGHZK00wmrJUjHr+8QZxcDjlg0 CIa7094Bw1fEl/R/Idbu8XDmzTYEVRVeJmlIr5gWOA== X-Google-Smtp-Source: APXvYqwos7WvYIQqqWWqUogHfETfT35eaGRAWlExs8ZOoMOJeR3E1BLLqRkliqxSdDz2iG5PlZ1EhrthGVA+LQklxHU= X-Received: by 2002:aca:55c1:: with SMTP id j184mr9249378oib.105.1573836126000; Fri, 15 Nov 2019 08:42:06 -0800 (PST) MIME-Version: 1.0 References: <20191115001134.2489505-1-jhubbard@nvidia.com> <20191115001134.2489505-3-jhubbard@nvidia.com> In-Reply-To: <20191115001134.2489505-3-jhubbard@nvidia.com> From: Dan Williams Date: Fri, 15 Nov 2019 08:41:55 -0800 Message-ID: Subject: Re: [PATCH 2/2] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages To: John Hubbard Cc: Andrew Morton , Christoph Hellwig , Ira Weiny , Jan Kara , Jason Gunthorpe , Jens Axboe , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , linux-nvdimm , Linux MM , LKML , Christoph Hellwig 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: On Thu, Nov 14, 2019 at 4:11 PM John Hubbard wrote: > > An upcoming patch changes and complicates the refcounting and > especially the "put page" aspects of it. In order to keep > everything clean, refactor the devmap page release routines: > > * Rename put_devmap_managed_page() to page_is_devmap_managed(), > and limit the functionality to "read only": return a bool, > with no side effects. > > * Add a new routine, put_devmap_managed_page(), to handle checking > what kind of page it is, and what kind of refcount handling it > requires. > > * Rename __put_devmap_managed_page() to free_devmap_managed_page(), > and limit the functionality to unconditionally freeing a devmap > page. > > This is originally based on a separate patch by Ira Weiny, which > applied to an early version of the put_user_page() experiments. > Since then, J=C3=A9r=C3=B4me Glisse suggested the refactoring described a= bove. > > Cc: Jan Kara > Cc: J=C3=A9r=C3=B4me Glisse > Cc: Christoph Hellwig > Cc: Dan Williams > Suggested-by: J=C3=A9r=C3=B4me Glisse > Signed-off-by: Ira Weiny > Signed-off-by: John Hubbard > --- > include/linux/mm.h | 27 ++++++++++++++++++++++++--- > mm/memremap.c | 16 ++-------------- > 2 files changed, 26 insertions(+), 17 deletions(-) Looks good, Reviewed-by: Dan Williams