Received: by 10.223.185.116 with SMTP id b49csp6020582wrg; Thu, 8 Mar 2018 00:01:05 -0800 (PST) X-Google-Smtp-Source: AG47ELu0sh6VuSTfOeH8y2H86s/E+J1/84pzxj9jeES39TJ1JNcDITnWPTcsocdOBx7+5jfJa5h6 X-Received: by 10.98.204.132 with SMTP id j4mr25759272pfk.35.1520496065647; Thu, 08 Mar 2018 00:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496065; cv=none; d=google.com; s=arc-20160816; b=JqPCTPHkqXIhucbEuBf5Twbn1gE602zZYyOFPSvSH+5HjzstXX1Tb/hCOmXsXkfVVa p7unp4f0BKwZt2H4BjOwMTLULaM+WFIoIPbCzLPfqQs6ryz0t3N81bCgdLIWvnQu/KbK aMV2CeRbsTi3eUtgyeVQN/ZDbUiuOdPGpEBNjJNb9YBpGMZ853eKaNYqcY2c9vioXysy +T7LxtAJ/lZ2z8In8u5vZZ53xOjZbYAX/duAyZYrXP6mfQNLCcOnGKjn7MYtLHizpbIy QNyVmfE5vFJF8bfukX+uihA57zj9Q036qwyOSc3Jd1Gp9uKUYhoRdCEg/ILUKH51XKO4 2VCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=36kK23Xn1lAD6bCVbBd44KMB+MsMnwVkSG9FQWLFmbY=; b=wlUZH9LJJ4LTsq4GsvtLlTt73vpmYb9vYdA1Sutjmx88q8bx+8Yx4EqdYRbE0xlPSq 51bCQii/RWsQbnmHP7JNK01eu7x3Mb4cMIH6lpIvq/PCm19ScKEsC7CutyNclz2nPT8K 3Z0VjMFJX1N8OYzsippZ43kUj9GQ7zKiaU38qak3KNWaxci8xEQZT7j5ClQf1qKt6xnF zioKTcTJVGMmfVBnZotnXnx5J79W/vlKDbBPXNGqhfOO46Z0dHorqQIPTvo03zHf5RZu QfYAFzBnvlLcCHRqoNe95cSya1dboNh8wjBxFa5dTUcfkYeb8AS6EC77CSg7i2MDYvMV LT1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=mCvhLjsh; 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 m11-v6si10312015pls.520.2018.03.08.00.00.50; Thu, 08 Mar 2018 00:01:05 -0800 (PST) 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; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=mCvhLjsh; 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 S935194AbeCHH7i (ORCPT + 99 others); Thu, 8 Mar 2018 02:59:38 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:44864 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754877AbeCHH7f (ORCPT ); Thu, 8 Mar 2018 02:59:35 -0500 Received: by mail-wr0-f196.google.com with SMTP id v65so4659154wrc.11 for ; Wed, 07 Mar 2018 23:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=36kK23Xn1lAD6bCVbBd44KMB+MsMnwVkSG9FQWLFmbY=; b=mCvhLjshW8ViUEP/spTMYC4O5eDWDU1qcs0GrB8O1OFZtGAbw6kH61pcV0wUAwFovy hnhOuQSLcH6u1JuQ/ykbPQXNkfuQiKb/LEpC3ETfhMS2hug5yiWfmlsux0P6/tJ2dFF2 6u5ElUUeykOSmCXi6l6u0owSO17Q5m/qUMbEHBFO5ZqVrUlpGdpoEogcM1libEX+j1wF 0jGZOxCei5LWRUWQMWP0mLi8XSQNOEU6DPJglbJqxctdGuM6wa1v3jExBkocNB+DtR5R FRimMDY6NJrE6rIhSN8XJYb2btHXSiMHpDFfvMjpOKqbeDHO0G1BIw0dz+NZAlk3TEhh aqxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=36kK23Xn1lAD6bCVbBd44KMB+MsMnwVkSG9FQWLFmbY=; b=UFOHr4SiOuRtJ3ZsBKDt5ES5Wwwhrker/c9ZxO/Ns7lBX4niPsO7FNn/ROWNLITKeQ cY8tRE7LuzlTIy0xLaiOF6KDx4ccpvYEw8W88WLsg2TamCFljR2I7TvHhUbHB06BK2Qp UKPDzPSDI6spfC/NRUS+cj2OBCDviUSx7wR6FaWgBXAYcZ3rTYz+yLVjvRTcfQ/RfzNJ K+pMHxB2V8MgYLe0pcm8QA0n/JaHgS66P08tG6w7Jj6J8FQj1Reu3XqrQpL/M2BbwMgc eGQqY5z2a+LtP/wVB5AuIPwA5YSF5UUuxSp7/jiOsB/DJcKki2ep59Vn72B1iRh1FgGd PDbg== X-Gm-Message-State: APf1xPDkFvpnRu7WIiGb+l5zdgem6oMv28lPGSt+T1+K//NqmXlLEcA2 Rpc14eRuKCMVB3T53Aw0o0eqjw== X-Received: by 10.223.188.18 with SMTP id s18mr22808338wrg.211.1520495974589; Wed, 07 Mar 2018 23:59:34 -0800 (PST) Received: from [192.168.0.153] ([95.146.144.186]) by smtp.googlemail.com with ESMTPSA id r98sm38007734wrb.70.2018.03.07.23.59.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 23:59:33 -0800 (PST) Subject: Re: [PATCH 6/6] lib/scatterlist: Drop order argument from sgl_free_n_order To: James Bottomley , linux-kernel@vger.kernel.org Cc: Tvrtko Ursulin , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Jens Axboe , "Nicholas A. Bellinger" , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org References: <20180307124712.14963-1-tvrtko.ursulin@linux.intel.com> <20180307124712.14963-7-tvrtko.ursulin@linux.intel.com> <1520447415.5558.12.camel@HansenPartnership.com> From: Tvrtko Ursulin Message-ID: Date: Thu, 8 Mar 2018 07:59:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1520447415.5558.12.camel@HansenPartnership.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 07/03/18 18:30, James Bottomley wrote: > On Wed, 2018-03-07 at 12:47 +0000, Tvrtko Ursulin wrote: >> From: Tvrtko Ursulin > > Firstly, I don't see any justifiable benefit to churning this API, so > why bother? but secondly this: Primarily because I wanted to extend sgl_alloc_order slightly in order to be able to use it from i915. And then in the process noticed a couple of bugs in the implementation, type inconsistencies and unused exported symbols. That gave me a feeling API could actually use a bit of work. >> We can derive the order from sg->length and so do not need to pass it >> in explicitly. > > Is wrong.  I can have a length 2 scatterlist that crosses a page > boundary, but I can also have one within a single page, so the order > cannot be deduced from the length. sgl_alloc_order never does this. However there is a different bug in my patch relating to the last entry which can have shorter length from the rest. So get_order on the last entry is incorrect - I have to store the deduced order and carry it over. In which case it may even make sense to refactor sgl_alloc_order a bit more to avoid wastage on the last entry with high order allocations. Regards, Tvrtko