Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp65010pxv; Tue, 29 Jun 2021 23:35:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCcabENgS5cEf1ai07WED8MM+Kk8+RHB93XH+NWOODrnkgOiSHC+XcMgrmMxeYIRtzhn+U X-Received: by 2002:a17:906:d20b:: with SMTP id w11mr34149613ejz.242.1625034921662; Tue, 29 Jun 2021 23:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625034921; cv=none; d=google.com; s=arc-20160816; b=EFRHvIflaTWHcaw3z8+YY7NtMrnPgzQ2IxzrDB3+sLfsZMEVznTJ2UrvyFP1PHwLUu OH7U5RvjKAVQHnak50gDfvxnBoFfbSANmouENicOST/8UJYNoUU9GVnvbqhxZXJGB6t/ vtIQ9C+LTrnJBrTgo0Pymt2l+sXQidrg/v+c0DjwbfXJfO/7dOu3jdYr9fn12r3vMNMT GYotIyyR94ozCbVqYn/x6DfaCNW6XkQ8SDX9asxdzhUbT7N5j3CzFNXQfcWudpw9Ep/k Awf0mV3nZca/3rU0JWhMwvVnFbfuTegSTcOBohw4s2Oc0sg+ehH9SwFvMnRM0OfPDl9I gsaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s7sfPSKomuf1f0Wmri9pkg7H5FgMkGeqUuukUkPYBw4=; b=J+HtN6Xst796ozWeoqNZGYrLUT6UHuwSg1CWy0PG4LZZBpzLpFwZCQJ9C8/fMwaZXi Dcrmojwh5RQVfMMTy6eGnkUcgGfWxFPfnYmVs4N8O+7mNkwBTPQP0SjdJq2QDc1lZfGV u2svP2GVGjXTlPyzVZGCzm91e+fLx+JI74+rpIz5rf10AifS37xdRzpFsgyfo9dXCv1x aiTA9nDHcNqFKXmCzugQ39YAozIKrNTgqqE54IY/7JIyxkfx6zlaBtwMxk0kntXpX+8r mUXvg2o6jGldvacUsFtt+U5QagjvHQWUw7KL73AN3x5VzpsOmSMzvN40ckG+I3onrOFo 5JOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bDxkUfCB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd38si1991539ejc.558.2021.06.29.23.34.57; Tue, 29 Jun 2021 23:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=bDxkUfCB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232220AbhF3Ggf (ORCPT + 99 others); Wed, 30 Jun 2021 02:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhF3Gge (ORCPT ); Wed, 30 Jun 2021 02:36:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A7BC061766; Tue, 29 Jun 2021 23:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=s7sfPSKomuf1f0Wmri9pkg7H5FgMkGeqUuukUkPYBw4=; b=bDxkUfCB9DBNCSJ5pKDUiiLE0c I3P40JU98JOtXN1eHqyJRrtQSb4BB9NqNa6V5k2n6RCFnDpPYBeqwHj3FiKrzCBBJGS2ObiEUbyhS ozyaQwbKrd1erV7NHHssqMaABAL5h6cNYLsq9i6vHNZJNxtIcKiGZyd7sZGCNotgoQ+JCBkiPc4oR vSmWidy1mlt+8vLxjL6J8pnZlhynoLLAz6lM45O7Og7clkhps4OD0tSwz1YaoY7zIR3YezD0bsB+o 6GR7eKmu3XDGK+QIhq6LKTMOdalq/ovZ5XZEpmHiLZ48YfrphXtHRxFZGFBMd+q424ei1UuDqcD+Y BU3nKJjA==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyTmf-004zWT-AC; Wed, 30 Jun 2021 06:33:23 +0000 Date: Wed, 30 Jun 2021 07:33:17 +0100 From: Christoph Hellwig To: Leon Romanovsky Cc: Christoph Hellwig , Doug Ledford , Jason Gunthorpe , Maor Gottlieb , Dennis Dalessandro , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Mike Marciniszyn , Yishai Hadas , Zhu Yanjun Subject: Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 09:29:51AM +0300, Leon Romanovsky wrote: > On Wed, Jun 30, 2021 at 06:59:11AM +0100, Christoph Hellwig wrote: > > On Tue, Jun 29, 2021 at 11:40:01AM +0300, Leon Romanovsky wrote: > > > 2. Add a new field total_nents to reflect the total number of entries > > > in the table. This is required for the release flow (sg_free_table). > > > This filed should be used internally only by scatterlist. > > > > No, please don't bloat the common structure. > > Somehow we need to store that total_nents value and our internal > proposal was to wrap sg_table with another private structure that is > visible in lib/scatterlist.c only. > > Something like that: > struct sg_table_private { > struct sg_table table; > unsigned int total_nents; > }; > > But it looks awkward. Well, the important point is that we only need it for the new way of collapsing, appending allocations. We should not burden it on all other users.