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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4703BEE49AB for ; Wed, 11 Sep 2024 13:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=bxYvtT3ZbBySkpF4wPbt0thynaF/fmTsnDLlO7eN+TM=; b=PuyBZdz7W7gjpi L1aF1g98WtR8Cd+xgJfVqDDQfPjFb1Sd46DhDquPaTnYTlkOg52o/OcM5GXy3tCN0PLz/tifhICy3 0DpwxqZaaKfcqoXk/EqIFY4+1cF1ULci+95BnMn2FN4KUEnCfLzFUMTm3yQlagK80tmhOXriYmXLf R4N0Duf/H5kB0GgJohDmyRwVoAUuQN3wJYfxNoYah+OgZuC9hbNTft18z4naWIA/r/WCPIDxz45Py EY5Fsc9pbPnEb2wnzI3D6HKNDvmkHYsqNGfZxAdyW8E3hsjxBSsz6Mbb3xtVfZRvuRhN2I2sF2vQo fw7mUC6gRuoxlB1lWtCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soNoq-00000009nd6-2CdO; Wed, 11 Sep 2024 13:55:40 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soNl3-00000009mHx-0LYW for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2024 13:51:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C11D15C01C8; Wed, 11 Sep 2024 13:51:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF906C4CEC0; Wed, 11 Sep 2024 13:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726062703; bh=esTHwqZQY89z5c47Uj1ctm3mtoh1ZJVRwU7dALV134M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NeyCdeiWUHf3IhSEPWgn2DkGBpDRb6SsxBs0RlFNx4Fczo9SA+YQUAs7N7MXjnlwH Gyy1v26ZHQEufa0y5X3aD8gjYfMyeELL8qUE+3IT4CaETrivxjLh7SrcITxVwztza/ VA8AFfg3ajOY04ThGUNZAC11cVEBrJTzICSAA12u+teMxc4mbJA/QuYMUZvA8W15uv whxc0cB3MSr0cZpm7J0awJF375VohEBUdzt/+7tvxuNOcCOiwPY4NzvlReDT3hx+/W B6u9ooKkI5apaP5bHY5GrIGwL9AX47T3mdgiRO06TIrTHWAd4q8mOybhrqk7+Zjwyv MiK8XtH8RPkVw== Date: Wed, 11 Sep 2024 08:51:41 -0500 From: Bjorn Helgaas To: Alistair Popple Cc: dan.j.williams@intel.com, linux-mm@kvack.org, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com Subject: Re: [PATCH 02/12] pci/p2pdma: Don't initialise page refcount to one Message-ID: <20240911135141.GA629523@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r09rgfjj.fsf@nvdebian.thelocal> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240911_065145_215536_02EEFFDD X-CRM114-Status: GOOD ( 14.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 11, 2024 at 11:07:51AM +1000, Alistair Popple wrote: > > >> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c > >> index 4f47a13..210b9f4 100644 > >> --- a/drivers/pci/p2pdma.c > >> +++ b/drivers/pci/p2pdma.c > >> @@ -129,6 +129,12 @@ static int p2pmem_alloc_mmap(struct file *filp, struct kobject *kobj, > >> } > >> > >> /* > >> + * Initialise the refcount for the freshly allocated page. As we have > >> + * just allocated the page no one else should be using it. > >> + */ > >> + set_page_count(virt_to_page(kaddr), 1); > > > > No doubt the subject line is true in some overall context, but it does > > seem to say the opposite of what happens here. > > Fair. It made sense to me from the mm context I was coming from (it was > being initialised to 1 there) but not overall. Something like "move page > refcount initialisation to p2pdma driver" would make more sense? Definitely would, thanks.