Received: by 10.223.185.116 with SMTP id b49csp4998266wrg; Wed, 7 Mar 2018 04:50:59 -0800 (PST) X-Google-Smtp-Source: AG47ELs17X21OHMr9DxvyIkInDq/JFpjvwUWv1t107Tv8EAmiYEqXR2WsXvYcXDVgH+50TJqimfo X-Received: by 2002:a17:902:8349:: with SMTP id z9-v6mr19937249pln.163.1520427059736; Wed, 07 Mar 2018 04:50:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520427059; cv=none; d=google.com; s=arc-20160816; b=VQVsNVwEMqJHNs+CFqlWpQajlis26S3BA1seFSld54Gw2WsJafcwEEH/IJfdT25GyS OKTItoaZrz72rzDj4XUKQa/OHzEsdN3n8G3o/lpiffOOQ1dwIdfPa1VmNaf9aN3lnKWM O6jXZl2V3LODHGIboUC3PKZFGeObpEWiS3+g744+2AMHtTyetL4mfN/fPu/mzBt1lhKj jv+AHWRSrCG0PfOe9zaMzfE8wj4lOjOcYs4l8ztmRDBGieuc6ytxPMiuPaZYTNmcgTst 2NuBtcTp9Gmx5KiOxc1zRDgmMhNxkUi+afX2UOp+V+ESHl9fsJg+bQGjR6O7c9c7tINj 6x+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=40srE4eolUYQx17c3beHHguSDGAW/+Upa+yP0dTGeDU=; b=1KpGEvNZHdHtoO6V5Wb1ge+Kx2lT+tx1VNq9Sjg5E/HhIn3dIpHrAYMir3Rxj4gtLU sX7rxVkxY5ZZXACUhv2ksHghvSQOCjwl08YTqiFhVDYkc2mYO2IwXUxCYHBtSqLhgMot IlnGwsVrmon22R60E4TYZe2onqapXop1STjN/7ILXgDSiGeFEFUdsFFSikwYNBfXMIKj ZFI+1Bt+148nZSEPOvGS3cXHvBJIS34vc4dqcyeypG2e7Lt9tQtlBNmP9KnebEG++dER xRVqpGYVo5mfRICO+ZCC+N310n0IYjJ1JgXlmHsOdiBkYS06Vt7cG03y5gDUUPPNOlFg zTYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ursulin-net.20150623.gappssmtp.com header.s=20150623 header.b=rWpDZmvQ; 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 v29si11284839pgc.526.2018.03.07.04.50.45; Wed, 07 Mar 2018 04:50:59 -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=rWpDZmvQ; 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 S1753935AbeCGMr2 (ORCPT + 99 others); Wed, 7 Mar 2018 07:47:28 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34208 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbeCGMr1 (ORCPT ); Wed, 7 Mar 2018 07:47:27 -0500 Received: by mail-wr0-f196.google.com with SMTP id o8so2059029wra.1 for ; Wed, 07 Mar 2018 04:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=40srE4eolUYQx17c3beHHguSDGAW/+Upa+yP0dTGeDU=; b=rWpDZmvQladPpRjUmXpFLBuyUJi8yA/z2T4WoVqV42xOLy9byspDr27izNyNkt84l9 uQVV5a6AhWG2zzurvyLITRf3DkipT+6IK8ua3Dwt1f3yVSC+T+nwGlWgS6Odj+qXapO5 1Z/3boDainfuZwG2HggBTweLc5J+qCiN/VUPZ2q8kCSobrIdrdGJN30Th+aD4csjAa+6 ZJcTEiyHxisp0VG9VAu7l/hfZwsOF3uGOXuCguo3Z9zYxJk8nKa+0gFnyfHOP6diKr/i D8q8+8T+0jb5dHeQ9d3lk2J2fnLVGUVFWaz0a/KwuRkERNEYCsmdNwPujfd+XeleeN5b tbfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=40srE4eolUYQx17c3beHHguSDGAW/+Upa+yP0dTGeDU=; b=l2uS7FynoOgbs1pNYunCJaDBXsOR/s4HSxQLuecT0ZvvnXknQ83xDeSUL6aQ/Ck2nU i+U038ZfsWkqPrjRyylcdmIn+CU4WKiyJzO+m8RRujgZa1s421TQcUlpf8qKRzACvBV5 JiXu+coRtPXzGEIl/+FXHPHOD457SK1ipLnLdk+VgSnO12CC+5YxHE//8mIZkcqtbFS7 l74Mi7dHXwyknfqlKjhAi04Bi/WNrXOlsxet+QcT1AdNk+8rXAcuZO23I2dDw7lj9RUl F0HaHkNx8OHmlBgQOJmZu2ew1fzzJzld31XT/8YFkd5Xwgvplz7UWbbWK4oSyCyToNL7 7n5g== X-Gm-Message-State: APf1xPCu5YAZ/xOrPUf5h4fCGQMTTSmCHnLrIuz+6JG8CNHZKCwNQtHV nG6y37GjEJbl0rTZIuD1pWU1M86W X-Received: by 10.223.172.167 with SMTP id o36mr20440164wrc.34.1520426846322; Wed, 07 Mar 2018 04:47:26 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id x78sm24325756wmd.2.2018.03.07.04.47.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 04:47:25 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: linux-kernel@vger.kernel.org Cc: Tvrtko Ursulin , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Jens Axboe Subject: [PATCH 0/6] lib/scatterlist: Small SGL tidy Date: Wed, 7 Mar 2018 12:47:06 +0000 Message-Id: <20180307124712.14963-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tvrtko Ursulin I spotted a few small issues in the recent added SGL code so am sending some patches to tidy this. My motivation was looking at sgl_alloc_order to potentially use from the i915 driver, with a small addition to support fall-back to smaller order allocation if so was requested. But then I realized scatterlist table allocated with sgl_alloc_order is not compatible with being put into the sg_table container due different allocator being used. If it had used the standard chained scatterlist allocation, it would benefit from less memory pressure for small-order large length allocations (in other words large nent - as it stands it can request really large kmalloc allocations for those cases), but to convert it to use that looks to would require some refactoring of the SGL API users. So I wasn't sure how feasible would that be. There were some other unclear bits to me in the SGL API, like why so much API some of which is unused, so I tried to trim that as well. So don't know - comments are welcome. Tvrtko Ursulin (6): lib/scatterlist: Tidy types and fix overflow checking in sgl_alloc_order lib/scatterlist: Skip requesting zeroed allocations in sgl_alloc_order lib/scatterlist: Do not leak pages when high-order allocation fails lib/scatterlist: Unexport some trivial wrappers lib/scatterlist: Drop unused sgl_free_order lib/scatterlist: Drop order argument from sgl_free_n_order drivers/target/target_core_transport.c | 2 +- include/linux/scatterlist.h | 36 +++++++++++--- lib/scatterlist.c | 91 +++++++++++----------------------- 3 files changed, 57 insertions(+), 72 deletions(-) --- Cc: Bart Van Assche Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Jens Axboe -- 2.14.1