From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E64392F23 for ; Mon, 3 Jul 2023 20:32:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FCA1C433C9; Mon, 3 Jul 2023 20:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688416328; bh=wwufjRtciEQ+b3u9cVB2o8qsKDTUrArMhXbZClwa5UU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rLwRCuL1fq6Cp/DK2ssr3/nP0PjTiQMy1CCd3S1byEHStDm6J7ziM3yVUpE3H30/o r88tbR3l9pJeK1B0b0gbN1nsqMW27tMaqNCmoQGlXeHafOac6ZimGx6fEq4hmpP2pp U9GzUp2900BxE/RTfphqPKlGPXq7z4cEj1OKKkuMyHCAh3rEyTnE967y5q7iKhcmIX sG56B1VlIiGNEvaNaq+Eg7c1EJtnijXF85rFCkMZEn5hlAyWNW0+UEnZ84eepEbIVa 8BXpZDlb2f499+Hsh4R3UmXVMSyhVWkb4bd5w8NMYq1kxR3q4epW3XAUHs6suppIUB 22oSbFCIDAyyQ== Date: Mon, 3 Jul 2023 13:32:07 -0700 From: Jakub Kicinski To: Alexander Lobakin Cc: Alexander Duyck , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maciej Fijalkowski , Larysa Zaremba , Yunsheng Lin , Alexander Duyck , "Jesper Dangaard Brouer" , Ilias Apalodimas , , Subject: Re: [PATCH RFC net-next 2/4] net: page_pool: avoid calling no-op externals when possible Message-ID: <20230703133207.4f0c54ce@kernel.org> In-Reply-To: <413e3e21-e941-46d0-bc36-fd9715a55fc4@intel.com> References: <20230629152305.905962-1-aleksander.lobakin@intel.com> <20230629152305.905962-3-aleksander.lobakin@intel.com> <69e827e239dab9fd7986ee43cef599d024c8535f.camel@gmail.com> <413e3e21-e941-46d0-bc36-fd9715a55fc4@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 30 Jun 2023 17:34:02 +0200 Alexander Lobakin wrote: > > I am not a fan of having the page pool force the syncing either. Last > > I knew I thought the PP_FLAG_DMA_SYNC_DEV was meant to be set by the > > Please follow the logics of the patch. > > 1. The driver sets DMA_SYNC_DEV. > 2. PP tries to shortcut and replaces it with MAYBE_SYNC. > 3. If dma_need_sync() returns true for some page, it gets replaced back > to DMA_SYNC_DEV, no further dma_need_sync() calls for that pool. > > OR > > 1. The driver doesn't set DMA_SYNC_DEV. > 2. PP doesn't turn on MAYBE_SYNC. > 3. No dma_need_sync() tests. > > Where does PP force syncs for drivers which don't need them? I think both Alex and I got confused about what's going on here. Could you reshuffle the code somehow to make it more obvious? Rename the flag, perhaps put it in a different field than the driver-set PP flags?