Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3525424ybg; Mon, 28 Oct 2019 14:20:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhki0E+023Hnr3sgEofS94O4nGGIkrYDfqqBZx97Yikr/eL5B40ORl1q+4uvEp4IQA+62Z X-Received: by 2002:a17:906:184e:: with SMTP id w14mr18522925eje.10.1572297625274; Mon, 28 Oct 2019 14:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572297625; cv=none; d=google.com; s=arc-20160816; b=bFTqzh+pCpioTZ4V13v863tv909MizhZvBwa0p44bnvMtAdO2U0SYDD5oTtZKfmX7k oHy6BBPS0bOroyM+bA82rUswujy35Y2562lROIa6b+jD1qxxdGjzYxC+7SRtDUSF3lqj diG8CxTjI1c8PppyNW3RBQw2JS7s2wJvyfEfJv1dXflWaJ6sNgtvmpAWBn9wMBnSscgQ 5TyLqIp2VbqEI3cEMgAw5U939gmPZCo+ZuEvnfZosq6lc//z/Z3emdP9KtScwdpHEy29 caJDUMgI3D/TvGSiAZPueJuqeih8/5VSilL+Uh7w+NQr4M5ic5kEu2kXoGgET9PYFZCU lsNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hSfuAznZxA5rdJvI94A+k5BryWZerPhQfUDajRhfjAw=; b=vGKJ+TtfSEtaSs+tz5ANV80BHoPZQ8TmnxiiwG+6dksHIgfsqlGdGYsR2hpVWiKaV9 PMVTWnU8P2Z/hd0funWhN9vIZfcGDSfdZj+qIQ7wE1DtW8nkymdHyPg7ZXkiiqGIhoTR FxXo6NPE/wXPXQXF6O2MUZ/ooH45hK2407lvSJdfEOEWEBFyUI/D5ji+7XXDfedXcPWT ddMIrHefnSQ1+SsZSl6bee/tvKIGrfSHahNM+65ko+/aERrnnt5/jp75xky/NhGwE4af ZbsvUtE6vnTWoRksPF+uTQkkR740I8x3iW6gJ4FuHccJ5kWsamFPP2tAI4YUzjwdSmxq WC1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a40si6618582eda.86.2019.10.28.14.20.01; Mon, 28 Oct 2019 14:20:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403787AbfJ1Qhf (ORCPT + 99 others); Mon, 28 Oct 2019 12:37:35 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46138 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729420AbfJ1Qhf (ORCPT ); Mon, 28 Oct 2019 12:37:35 -0400 Received: by mail-pl1-f196.google.com with SMTP id q21so5826559plr.13 for ; Mon, 28 Oct 2019 09:37:34 -0700 (PDT) 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:user-agent; bh=hSfuAznZxA5rdJvI94A+k5BryWZerPhQfUDajRhfjAw=; b=BvMkvQXGqhbznp+6Q7/yM2t3RcSb+fY3FWXlhZPR7tHpu4ppbIjtxEjxbDJrAxECpf R8+Z/zvGs+lLq8jIIaouNdibHh6eyocmy/ICuPPRcswFui+nqkleyT2a9sfJVrZY6cKQ BzZNOzsow1tnnvSIca7dZXbrNZdLVbUC0JrpzNTLow1bYQcwlVf3mDd8qxg1kIv3Yb8j recTNHjYxy9sxs/hhMy5ed5I0ZLn3qlrFVPuMycsOpvQp5nCgTOan3Sz2gx8IP/wWnnZ EKy+Xw8jmXmK7Rzdi+EvzxzRpFkmJ6WQSV1ANmwaDNh6mhxTujiG6dUAuj6+4L6QtEs2 OwZg== X-Gm-Message-State: APjAAAVesKoDJI4QoFDiB/5nO/lsY/N7hCXPfWLMhOu053pLBNb10P/V HWuHMhVxu2T2FIAzbB2ODU7PjS/ZCJo= X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr225260plo.190.1572280654346; Mon, 28 Oct 2019 09:37:34 -0700 (PDT) Received: from sultan-box.localdomain ([104.200.129.62]) by smtp.gmail.com with ESMTPSA id i123sm13394020pfe.145.2019.10.28.09.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 09:37:33 -0700 (PDT) Date: Mon, 28 Oct 2019 09:37:32 -0700 From: Sultan Alsawaf To: Christoph Hellwig Cc: Jason Gunthorpe , "Martin K. Petersen" , Thomas Hellstrom , Palmer Dabbelt , Sakari Ailus , Ming Lei , Gal Pressman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] scatterlist: Speed up for_each_sg() loop macro Message-ID: <20191028163732.GA32763@sultan-box.localdomain> References: <20191025213359.7538-1-sultan@kerneltoast.com> <20191028141734.GD29652@ziepe.ca> <20191028161848.GA32593@sultan-box.localdomain> <20191028162320.GF29652@ziepe.ca> <20191028162816.GA17182@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191028162816.GA17182@infradead.org> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 28, 2019 at 09:28:16AM -0700, Christoph Hellwig wrote: > And there is nothing forcing a particular layout, there just happens > to be a layout that the generic allocator gives you. I'm not even > sure the original patch handles the SCSI case of small inlines segments > properly. I'm doubtful; are there really sg users that craft their own sglists and then use for_each_sg() on them? But like I mentioned in the email I sent a few minutes ago, this can be alleviated with a more comprehensive version of this patch that alters all for_each_sg() users and thus ensures that only sg_table pointers can be used with the macro. Anyone who would munge their own sg_table together would simply be insane :) Or there could be a separate macro for iterating through each sg in an sg_table. There are lots of ways to go about this. Sultan