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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 2F355C43461 for ; Tue, 8 Sep 2020 19:39:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 048352098B for ; Tue, 8 Sep 2020 19:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732254AbgIHTju (ORCPT ); Tue, 8 Sep 2020 15:39:50 -0400 Received: from verein.lst.de ([213.95.11.211]:53199 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730929AbgIHPy7 (ORCPT ); Tue, 8 Sep 2020 11:54:59 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 6E65568BFE; Tue, 8 Sep 2020 17:54:09 +0200 (CEST) Date: Tue, 8 Sep 2020 17:54:09 +0200 From: Christoph Hellwig To: Maor Gottlieb Cc: Christoph Hellwig , Leon Romanovsky , Doug Ledford , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH rdma-next 3/4] lib/scatterlist: Add support in dynamic allocation of SG table from pages Message-ID: <20200908155409.GB13593@lst.de> References: <20200903121853.1145976-1-leon@kernel.org> <20200903121853.1145976-4-leon@kernel.org> <20200907072921.GC19875@lst.de> <15552707-c9ae-b76b-f6ff-7fedd5b02aed@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15552707-c9ae-b76b-f6ff-7fedd5b02aed@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 07, 2020 at 03:44:08PM +0300, Maor Gottlieb wrote: >>> +{ >>> +#ifdef CONFIG_ARCH_NO_SG_CHAIN >>> + if (append->left_pages) >>> + return ERR_PTR(-EOPNOTSUPP); >>> +#endif >> Which makes this API entirely useless for !CONFIG_ARCH_NO_SG_CHAIN, >> doesn't it? Wouldn't it make more sense to not provide it for that >> case and add an explicitl dependency in the callers? > > Current implementation allow us to support small memory registration which > not require chaining. I am not aware which archs has the SG_CHAIN support > and I don't want to break it so I can't add it to as dependency to the > Kconfig. Another option is to do the logic in the caller, but it isn't > clean. But does the caller handle the -EOPNOTSUPP properly? I think right now it will just fail the large registration that worked before this patchset. Given that ARCH_NO_SG_CHAIN is only true for alpha, parisc and a few arm subarchitectures I think just not supporting umem is probably cleared. And eventually we'll need to drop ARCH_NO_SG_CHAIN entirely.