Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4177396pxk; Tue, 8 Sep 2020 12:41:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9068rDNVYyUgiooAU71JJOh6PJSrDTtP0EzF8FoP+UGzTH5uCIl82a1wB5SgVI7PGgJGt X-Received: by 2002:a50:9d0a:: with SMTP id v10mr652788ede.144.1599594116042; Tue, 08 Sep 2020 12:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599594116; cv=none; d=google.com; s=arc-20160816; b=x10wOkRWl5FQxUvIxuU1hCSqlDZrUZUXL99tSXhFNDqve+gehyT/ZFMuax3JOby30F uCCf4Z1TBhRcjqvlziwXqgrpHOQC2r7yH6Pcm0qS2IOWVT6LAGeZw8qdYxJNATI2G6E6 GIgWHkuQ/9aXqNQkk5dKHnizEOfH8VGMowdmzpPrW+R+zVORthBTGu1TJE3Z3OWyPyVw zRXoncQ4ynzZ8z/pvst4CHTLcBk17LnabbdYz2LXpcjAYM/IxXdeeuQdjIsUS2OH+yJO QH7a6fflsT0KmXCD+S2csa8A7UIUPyKqXmAZm6DQryl6q3MCuhAaZQ3sSTPsjExagWwF t9DQ== 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=HJ/yx+I0asZo4ySlQQw3FhAiY5Nke2G0kuhjim0Gqgw=; b=LflrPMdlFyN4hBgOs3i2NjhlRptvRzzMKhfGoVx+TxXRHl++kfxXBmdkGyuTYkPpaC l6RH5Xvc+VNQyKQClsZ3rdyTqvpVPT1s/tKrYsP6zYukSRlvUCaZO+MqZy50PYZTCXOR MQp5NEfE8sWVewPqCI89Rmoueong69Sj8TLTS9wjltjUMYdQptETPY9FOLwVObaBIerV Nkujf1dgpwbf/iPMJ6iVyVP1G6QsspmbbAJvrlQ/dMHVHC1iv30I49huOfDKVDJHezKi ICZAsfk1NLWAmGzMVlMPjIY9n5Ji6k8L3iuDrnpleN2ay0bJG8uf+AA7ta2HhVT9kDTn jGWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c25si26777eds.548.2020.09.08.12.41.33; Tue, 08 Sep 2020 12:41:56 -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; 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 S1732205AbgIHTjq (ORCPT + 99 others); Tue, 8 Sep 2020 15:39:46 -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.