From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: PATCH: Further aacraid work Date: 17 Jun 2004 23:25:59 +0200 Sender: linux-scsi-owner@vger.kernel.org Message-ID: <20040617212559.GA71701@colin2.muc.de> References: <286GI-5y3-11@gated-at.bofh.it> <286Qp-5EU-19@gated-at.bofh.it> <20040617205414.GE8705@devserv.devel.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from colin2.muc.de ([193.149.48.15]:27918 "HELO colin2.muc.de") by vger.kernel.org with SMTP id S263790AbUFQV0B (ORCPT ); Thu, 17 Jun 2004 17:26:01 -0400 Date: Thu, 17 Jun 2004 23:25:59 +0200 Content-Disposition: inline In-Reply-To: <20040617205414.GE8705@devserv.devel.redhat.com> List-Id: linux-scsi@vger.kernel.org To: Alan Cox Cc: Andi Kleen , Anton Blanchard , mark_salyzyn@adaptec.com, Christoph Hellwig , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org On Thu, Jun 17, 2004 at 04:54:14PM -0400, Alan Cox wrote: > I would rather see it below the I/O layer for things like AMD64. The > reason I say this is that many drivers would suffer from iommu merging not > gain, and others may have limits. > > Something like > > new_sglist = sg_squash(old_sglist, [target max segments], [max per seg]) > > could be used by drivers when appropriate to hand back a better sg list > (or if not possible the existing one). That would put control rather closer > to the driver. My understanding was that it was too late in the driver because the SG lists are already sized, because higher layer manage this. That is why the BIO_VMERGE_BOUNDARY define is checked by BIO, not the driver. The input of sg_squash should not be an already mapped list (that would be too costly) better would be probably a pci_map_sg_merge() with hints that tries to merge and other than that works like normal pci_map_sg() -Andi