From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C66B8C11F69 for ; Wed, 30 Jun 2021 06:34:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9468E61459 for ; Wed, 30 Jun 2021 06:34:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232389AbhF3Ggf (ORCPT ); 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.