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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0D7BEC4361B for ; Thu, 17 Dec 2020 22:35:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B5812360D for ; Thu, 17 Dec 2020 22:35:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B5812360D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E3D106B0036; Thu, 17 Dec 2020 17:35:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC4256B005D; Thu, 17 Dec 2020 17:35:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB2FB6B0068; Thu, 17 Dec 2020 17:35:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id B5CF26B0036 for ; Thu, 17 Dec 2020 17:35:12 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7D070180AD81F for ; Thu, 17 Dec 2020 22:35:12 +0000 (UTC) X-FDA: 77604231264.30.cows79_01073a327438 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 564E6180B3C85 for ; Thu, 17 Dec 2020 22:35:12 +0000 (UTC) X-HE-Tag: cows79_01073a327438 X-Filterd-Recvd-Size: 5168 Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 22:35:11 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BHMNlhh138563; Thu, 17 Dec 2020 22:35:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=Rj9JexLQvCq04VdywbMjg/pDy339pdcvwh3h1VS2XJk=; b=q7u+TFNC9C6A3Ev2o074el7vk5+7DkDIuH7INufTPS2OwTHn2BUkbFpf17dNL/2SClzJ 8SqKsmuQZs/TsKwtcOBa8XFs/LFrYe170ntiGA8QCLm3sWWmec2fp5Pu4MJpq0faLJkD XVZHonDI+2XPcmJdVHx7mM/KjZ9d4kRwGUnrB1aV63RJ/jjR7mhFJ9wmIEhdBN5y4UyP TUcdGbX2b5QdeMBvuBuxRYkndZ6+jp7+JajKq6u0HvTpAPd4Z9hjeOODNEuCOUBABlpo LgAupZgSKLxxrWvKa74j4Sx12Y9qw9Ui0MV77NuF1X+nuoBvSzQzdZutkvdrCAvUGwv+ PA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 35ckcbr13f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 17 Dec 2020 22:35:03 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BHMKNf4031276; Thu, 17 Dec 2020 22:35:02 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 35d7t123qf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Dec 2020 22:35:02 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0BHMYx29017874; Thu, 17 Dec 2020 22:34:59 GMT Received: from [10.175.218.25] (/10.175.218.25) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 17 Dec 2020 14:34:59 -0800 Subject: Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages To: Jason Gunthorpe Cc: linux-mm@kvack.org, Dan Williams , Ira Weiny , linux-nvdimm@lists.01.org, Matthew Wilcox , Jane Chu , Muchun Song , Mike Kravetz , Andrew Morton , Daniel Jordan , John Hubbard References: <20201208172901.17384-1-joao.m.martins@oracle.com> <20201208172901.17384-9-joao.m.martins@oracle.com> <20201208193446.GP5487@ziepe.ca> <20201217200530.GK5487@ziepe.ca> From: Joao Martins Message-ID: <7c8078df-1151-3668-5cee-80c976df1ff6@oracle.com> Date: Thu, 17 Dec 2020 22:34:54 +0000 MIME-Version: 1.0 In-Reply-To: <20201217200530.GK5487@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9838 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012170146 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9838 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012170146 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 12/17/20 8:05 PM, Jason Gunthorpe wrote: > On Thu, Dec 17, 2020 at 07:05:37PM +0000, Joao Martins wrote: >>> No reason not to fix set_page_dirty_lock() too while you are here. >> >> The wack of atomics you mentioned earlier you referred to, I suppose it >> ends being account_page_dirtied(). See partial diff at the end. > > Well, even just eliminating the lock_page, page_mapping, PageDirty, > etc is already a big win. > > If mapping->a_ops->set_page_dirty() needs to be called multiple times > on the head page I'd probably just suggest: > > while (ntails--) > rc |= (*spd)(head); > > At least as a start. > /me nods > If you have workloads that have page_mapping != NULL then look at > another series to optimze that. Looks a bit large though given the > number of places implementing set_page_dirty > Yes. I don't have a particular workload, was just wondering what you had in mind, as at a glance, changing all the places without messing filesystems looks like the subject of a separate series. > I think the current reality is calling set_page_dirty on an actual > file system is busted anyhow, so I think mapping is generally going to > be NULL here? Perhaps -- I'll have to check. Joao