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,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 F2B7EC4361B for ; Thu, 17 Dec 2020 20:05:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 53C9F233FD for ; Thu, 17 Dec 2020 20:05:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53C9F233FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6DDC16B0036; Thu, 17 Dec 2020 15:05:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 68DAF6B005D; Thu, 17 Dec 2020 15:05:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57B606B0068; Thu, 17 Dec 2020 15:05:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 431826B0036 for ; Thu, 17 Dec 2020 15:05:33 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EF4AA181AEF32 for ; Thu, 17 Dec 2020 20:05:32 +0000 (UTC) X-FDA: 77603854104.16.fight60_260afda27437 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id C21E1100E690C for ; Thu, 17 Dec 2020 20:05:32 +0000 (UTC) X-HE-Tag: fight60_260afda27437 X-Filterd-Recvd-Size: 4485 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 20:05:32 +0000 (UTC) Received: by mail-qk1-f180.google.com with SMTP id c7so27657879qke.1 for ; Thu, 17 Dec 2020 12:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UAHMmFRhpmUKzCB9OVILBe1nVZx9d9RuhwceHo6X2oA=; b=iMfK70NsBytdi7jizAC4psxAq0uJanM8NMKxRFJmMm7cMiyEF7LiTZcALWNLZiPPgT xDO4Vw/GKc890B71O+67Zc9U95vmltiXS9okKMBKxnWv8Iuszs9iQeE3LyH/w06GlRAv Me+AArGrR0VXr06RLZWbaZqDsS5AmLgZRDPy9r+m8q2dLyosLt7lcV212nbRDCFkQiPF oGyM3cJfY9Vb52dZFPRbNpj2om8aLuLnhjY3nM55KoqJ1HrVSctYeklTKh4n+J9H/9wC 8fXoacNNgAE8to8JYAcCxHGqMRz2edxHzLGLkbO5pZWPEgguGn9UgpcTCirPCX7vLR7r /gAQ== 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=UAHMmFRhpmUKzCB9OVILBe1nVZx9d9RuhwceHo6X2oA=; b=VUFGG+EK05qo/wQ3fpzrwWNrXuwLRSXH0SXK3MnAnaiyC5qvua7lcBBhUy+1nJaKo1 MliTGKOZuaYJNQveqmf0GFRTpttRaaQXaTBMbjTc2MJ+rT44Hv97ZhXVUb71qmwmkBNf U0ML0O6zqzh26lrvo4zdNNwS3qk0u3heejhHvM1hKtEnYb2nixaf9IPB/EWr1rfDPKl7 BHAetPC/ekAb7UX7e5lM0qgRJrlEuTUo8X7RjGPO+EQVlz9Kqn6B7+GYgR1EZKdbIwOd 5wNFlmweNfYaAm0o74ORaTGHqJuJeAdeCdyUS4EyNPAMTp6LJvK60RHHm3WABWAHbvt4 PHAQ== X-Gm-Message-State: AOAM530WRT22znTlRc9rlgG+MMMKfgpk+ajK3DvhsWLZ8tzLTrblwQG6 PyeyOGgeQIBKGUaRy2rqioOmGA== X-Google-Smtp-Source: ABdhPJy2JNUdM9wZ7MVVYBUyYGaPOnyAeWFOsWB6jQ2WNgNlQQGYmehhEuXOu1Z+43Z/70EQs/WLEQ== X-Received: by 2002:a37:a1d6:: with SMTP id k205mr1043857qke.384.1608235531599; Thu, 17 Dec 2020 12:05:31 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id 195sm4259652qke.108.2020.12.17.12.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 12:05:30 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kpzWk-00CMTu-15; Thu, 17 Dec 2020 16:05:30 -0400 Date: Thu, 17 Dec 2020 16:05:30 -0400 From: Jason Gunthorpe To: Joao Martins 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 Subject: Re: [PATCH RFC 7/9] mm/gup: Decrement head page once for group of subpages Message-ID: <20201217200530.GK5487@ziepe.ca> References: <20201208172901.17384-1-joao.m.martins@oracle.com> <20201208172901.17384-9-joao.m.martins@oracle.com> <20201208193446.GP5487@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, 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. 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 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? Jason