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.7 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 22A72C352A4 for ; Fri, 7 Feb 2020 13:17:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DC36D22314 for ; Fri, 7 Feb 2020 13:17:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="zXiaaJaV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC36D22314 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 750136B0007; Fri, 7 Feb 2020 08:17:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 700466B0008; Fri, 7 Feb 2020 08:17:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5ED146B000A; Fri, 7 Feb 2020 08:17:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 45B9D6B0007 for ; Fri, 7 Feb 2020 08:17:53 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0365F181AEF10 for ; Fri, 7 Feb 2020 13:17:53 +0000 (UTC) X-FDA: 76463383626.12.price51_44c29355f7c22 X-HE-Tag: price51_44c29355f7c22 X-Filterd-Recvd-Size: 4514 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Feb 2020 13:17:52 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id o15so2103782ljg.6 for ; Fri, 07 Feb 2020 05:17:52 -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=ba9Ucml+v2OTytbP0bUzj1lRLisFQOwA6sbKadxht3NxxQcvWJjj1qHHXt3Thvjj9I zvlOxWuSrSfg2FA+AHQ5z9YS/zti2IWKkIjTD6KHr6WD13v+IAcjB7vya+k6pjU4z/YB KZx9ldTPhVW6+4xSuoKrjgur1Z45sipfPujc7BHjlZ8pDqMWnjKdyPy+EXJs+u+FXDAL N53oeAabd8BbOEwXRA3wxnz9xdDXbvtXthU9hDYwQjNpzluuVtRtmoeXbrYeEL6YPC7+ kQ9rAKauOqVE4MUWM8GfnU67HnRfW4ZFELV3fUYJIXqfnHuXX+QUKt5e2yXdyf99lPQo uTbg== X-Gm-Message-State: APjAAAUMPC+SrV0/uuGNR+Mb0/chVI3J+rqNiYRBNbxAC/uz5Fqs93Nb bjrrXNpaFY0K+u0ANVCTxFackg== X-Google-Smtp-Source: APXvYqxpnU/YqzHLLTtDrHtrmgEZwjR2XCzlQQy/QlYwTJZA8pqDeflD/7gMq3smNNvvvq1H14aHzw== 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> 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, 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