Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp604471ybv; Fri, 7 Feb 2020 05:20:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwFVloDCZIPNjzY4iqhhByq6j8R7HWYfNZiK43miuNAM65uoYTzFQVwOXtl0ht2ywA1fZWr X-Received: by 2002:a05:6830:1f1c:: with SMTP id u28mr2740970otg.143.1581081603154; Fri, 07 Feb 2020 05:20:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581081603; cv=none; d=google.com; s=arc-20160816; b=rvR+nRx5ymZAiiTHxti7Irol0iYciSAzM5djC7BtU9GhwMs+kgfO0pTdtO8UjTPwZZ BijPTxkfeEs4/JcvzYhHdS7a9wyIeor8h3ZrUqVa1n82p4FYIPmQJY27p1HjJdEFOT06 5v07dy6/r8/99DAWfHwSpsGENxmI+8nm8kpPeZXE0/w3zCrJdq8YKbUVLNo/Rt4ng0cT sTYxqf1VWzMkbOXGMK0tGMmZZdpEyNvXnjgpQxY4xdc30i2BB3Z7nMy21KEsjT6c9bPe rfirZU3z1kgxB2NqEeCz3zoy/zhsApYxZPMvucTBoAtReRYfsJgRkeoWGrZ7aZc8M5GC 3mNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ormWsvlEB3xaoLQJ32yqI2+YJjynCIo+Gkrsb90CUoc=; b=azjorausii8MlQaF7gdOSgL9H4jmFSRsZAEN4HR8963tgybhxynCY+zo5kYAEtmHnD PsRAZAnFQQ9AWlVJ7J1tqmzRR+7JuSC2PDh4EaV12Dq/pKhY4cAojrDoW2Z3gziPbe/6 YiB09miX06xVP4lFI4SLwXzDSOZHsFK3bBfqcwSTuW7fPPLAoUB49nMh8i6O6/j6+fVH 6aMNsEZP5abWtR/unr9CD3Y/bOVTk2rDuZYupmvjVz0/7o0Lx9TO5ZTYym8VVIqKI3vq TU2rYLHOSv10DcD47v+qxzwQFNqOmYaCVwtqB/Oaxn94zZmOYkKJq/Rpd0t5uokdUkZC qP3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=zXiaaJaV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n21si3799421oic.0.2020.02.07.05.19.51; Fri, 07 Feb 2020 05:20:03 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=zXiaaJaV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727178AbgBGNRx (ORCPT + 99 others); Fri, 7 Feb 2020 08:17:53 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41474 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgBGNRx (ORCPT ); Fri, 7 Feb 2020 08:17:53 -0500 Received: by mail-lj1-f195.google.com with SMTP id h23so2098399ljc.8 for ; Fri, 07 Feb 2020 05:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ormWsvlEB3xaoLQJ32yqI2+YJjynCIo+Gkrsb90CUoc=; b=zXiaaJaV/6vtSOmP9ODS2FF3enQ9DrLr2xaXqFISXdgWNN7JEZGqqteYAJg8ilecHC ugo7pUkEj4BeIf0kvvpCo+9nvJTidcqrfgAKlXwcZrT/G25Hc0OKXxZ/73AFix6/STWU kzL1F0LE/LTZEKILuppx9YGI01N+5ZbDcEQGL0HvU+uZcMgWGZCPrEAiaZ+BllPyAS7f imqyuyZC2NI4FLBEhH4BIw6rEMsgDbGkg9nOxXihh8ryQwuUgPpw2KkNvbQrfWBn7wd+ mDYhZSynO7JxUG39HhOZIVunHOvL6zWKn3v9WqBVZysmR4JglhGrT7lyZay33uwkGfhZ Lp9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ormWsvlEB3xaoLQJ32yqI2+YJjynCIo+Gkrsb90CUoc=; b=SsknW5qftnwvH9n152gVD6ruEm2GfULLgbIJ87I6a9LNr729ksFX7zZmMa7hsdoPOt 4b7JezdSO2XzCICupLv6i50cfZkNPc1wFuyyox2pyUOPeGNLlOEv8Bxnr0zpJq5HHC+h QF+iPLgFi1PlacZEAGFnAWuZX/8hWVDovgn4PAmiga+JGPc3aKJ0ucLz1v3s10/qCoDi 62usTj4un483lcdIpxLEdW8wvlCQTsj2o+XRQZroU0cBWuNOmDXCJ62dvDOkA70eZdEE J2CVQtOhubeSR5q8T6iKK1GYHxfPPt6mZYgllFfJxz6kDT5pOCC2WSe2qQufuevpZR8X DZnQ== X-Gm-Message-State: APjAAAWMizo8S8mKKQmfSv/FQQ0feEqoQsVOcmCwEtdV16eDurJ54JWx TP1vbvzesMKsrNgln8ejKhogSw== X-Received: by 2002:a2e:7818:: with SMTP id t24mr5296927ljc.195.1581081470799; Fri, 07 Feb 2020 05:17:50 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id 3sm1236687lja.65.2020.02.07.05.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 05:17:49 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 623C7100B12; Fri, 7 Feb 2020 16:18:06 +0300 (+03) Date: Fri, 7 Feb 2020 16:18:06 +0300 From: "Kirill A. Shutemov" To: John Hubbard Cc: Andrew Morton , Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jan Kara , Jason Gunthorpe , Jonathan Corbet , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v5 04/12] mm: introduce page_ref_sub_return() Message-ID: <20200207131806.xwnhxomxgt3hoqcc@box> References: <20200207033735.308000-1-jhubbard@nvidia.com> <20200207033735.308000-5-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200207033735.308000-5-jhubbard@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 06, 2020 at 07:37:27PM -0800, John Hubbard wrote: > An upcoming patch requires subtracting a large chunk of refcounts from > a page, and checking what the resulting refcount is. This is a little > different than the usual "check for zero refcount" that many of the > page ref functions already do. However, it is similar to a few other > routines that (like this one) are generally useful for things such as > 1-based refcounting. > > Add page_ref_sub_return(), that subtracts a chunk of refcounts > atomically, and returns an atomic snapshot of the result. > > Reviewed-by: Jan Kara > Signed-off-by: John Hubbard Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov