From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751172AbbFKGvG (ORCPT ); Thu, 11 Jun 2015 02:51:06 -0400 Received: from 8bytes.org ([81.169.241.247]:36770 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbbFKGu6 (ORCPT ); Thu, 11 Jun 2015 02:50:58 -0400 Date: Thu, 11 Jun 2015 08:50:56 +0200 From: Joerg Roedel To: Dan Williams Cc: Jens Axboe , Michal Simek , Russell King , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Julia Lawall , "dmaengine@vger.kernel.org" , David Woodhouse , Christoph Hellwig , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 1/2] scatterlist: use sg_phys() Message-ID: <20150611065056.GG20384@8bytes.org> References: <20150609162659.21910.41681.stgit@dwillia2-desk3.amr.corp.intel.com> <20150609162710.21910.57295.stgit@dwillia2-desk3.amr.corp.intel.com> <20150610093252.GA20384@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 10, 2015 at 09:00:31AM -0700, Dan Williams wrote: > > So sg_phys() turns out to be 'page_to_phys(sg_page(s)) + s->offset', > > which makes the above statement to: > > > > page_to_phys(sg_page(s)) + s->offset - s->offset; > > > > The compiler will probably optimize that away, but it still doesn't look > > like an improvement. > > The goal is to eventually stop leaking struct page deep into the i/o > stack. Anything that relies on being able to retrieve a struct page > out of an sg entry needs to be converted. I think we need a new > helper for this case "sg_phys_aligned()?". You still have a reference to a struct page, because sg_phys() calls sg_page() too. If you want to get rid of sg_page() something like sg_pfn() migth be a more workable solution than sg_phys_(page_)aligned. But maybe I am just missing the bigger scope of this, so I agree with Russell that it is better so see a patch series which shows the direction you want to go with this. Joerg