Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2656301pxu; Sun, 18 Oct 2020 10:18:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXR7p6XVyrle1A1Kt+hA8S6slEJo7UtGdTWbROqCEgXkHSLTXt6dAK2Z/ZrzB6wZRNPFtW X-Received: by 2002:a17:906:375a:: with SMTP id e26mr13916316ejc.463.1603041491842; Sun, 18 Oct 2020 10:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603041491; cv=none; d=google.com; s=arc-20160816; b=etHIxQrtOG6N94YZib0QbNHddIXtLWe6cjssg4XgYGX0lWdVrYKsczCa17B966fiZb YsuZy6duEQBYr5tN42+/51ngEzCEeIMjx3qJ/VxjLWSjaxyNe390Fs/FBk0ujYNVWMXv k1nJKCFRJm70JBx/G/9AYw/kW5VtclUP2Oqrrcf6ofjnfO6PDd0gkQRFXKXAklU1TC0L XNExz6tNduRJdjA3oykDlZpCUfZLUx9ML6NZbEa84alIVnWqp8yC1p16uCaq8mc2g+U4 yUa5afv6bWDwR2xDeA6TgDPWIdnlYt1i3Jmm/m8etEXJbfgGfrWxbKJmV119MFZAHtZC kJnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=EH2UVCUNDrsGoArxQ8zJapGk+Df7AK4sw6g0sepc1Es=; b=FgUzP2+SJ/kR6338YlevwotHviTI0aG1OTIiOh89t8YXdPh1itxIrTyAl1Y91YPwVj ulDjitXfxZQc0OVhYjTt/K2U2jfLMM5zZSAEMOTmHsDh+R/N94xM0oPWkTuUyNe6ADki PvARMgrN4PW4rw1xWX+nP7ejZUsghNfATuXI9//TN7GZn5VbtP2JM2kfPpEaWoWIh3Ba eGkTawNNa5IGiGlU0XKKictZHf2gtpYo5xsBcKZNUxac+hYreidN500igoYp+wxQ/QLc MF5ovzAFuoG4LZdyf9l+2NiMXtf/1P6cvj8hi+qwFyXm3acMJ4yecsNajsBksSsh6k3g KJLQ== 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 a18si6407030edy.437.2020.10.18.10.17.49; Sun, 18 Oct 2020 10:18:11 -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 S1727368AbgJRRNv (ORCPT + 99 others); Sun, 18 Oct 2020 13:13:51 -0400 Received: from smtp.infotech.no ([82.134.31.41]:52030 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbgJRRNu (ORCPT ); Sun, 18 Oct 2020 13:13:50 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id BF9D020424C; Sun, 18 Oct 2020 19:13:47 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nx0fHgccNeh3; Sun, 18 Oct 2020 19:13:41 +0200 (CEST) Received: from xtwo70.bingwo.ca (host-104-157-204-209.dyn.295.ca [104.157.204.209]) by smtp.infotech.no (Postfix) with ESMTPA id 8CC6220418E; Sun, 18 Oct 2020 19:13:39 +0200 (CEST) From: Douglas Gilbert To: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: martin.petersen@oracle.com, axboe@kernel.dk, bvanassche@acm.org, bostroesser@gmail.com Subject: [PATCH v2 0/4] scatterlist: add new capabilities Date: Sun, 18 Oct 2020 13:13:32 -0400 Message-Id: <20201018171336.63839-1-dgilbert@interlog.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Scatter-gather lists (sgl_s) are frequently used as data carriers in the block layer. For example the SCSI and NVMe subsystems interchange data with the block layer using sgl_s. The sgl API is declared in The author has extended these transient sgl use cases to a store (i.e. a ramdisk) in the scsi_debug driver. Other new potential uses of sgl_s could be for caches. When this extra step is taken, the need to copy between sgl_s becomes apparent. The patchset adds sgl_copy_sgl() and two other sgl operations. The existing sgl_alloc_order() function can be seen as a replacement for vmalloc() for large, long-term allocations. For what seems like no good reason, sgl_alloc_order() currently restricts its total allocation to less than or equal to 4 GiB. vmalloc() has no such restriction. Changes since v1 [posted 20201016]: - Bodo Stroesser pointed out a problem with the nesting of kmap_atomic() [called via sg_miter_next()] and kunmap_atomic() calls [called via sg_miter_stop()] and proposed a solution that simplifies the previous code. - the new implementation of the three functions has shorter periods when pre-emption is disabled (but has more them). This should make operations on large sgl_s more pre-emption "friendly" with a relatively small performance hit. - sgl_memset return type changed from void to size_t and is the number of bytes actually (over)written. That number is needed anyway internally so may as well return it as it may be useful to the caller. This patchset is against lk 5.9.0 Douglas Gilbert (4): sgl_alloc_order: remove 4 GiB limit, sgl_free() warning scatterlist: add sgl_copy_sgl() function scatterlist: add sgl_compare_sgl() function scatterlist: add sgl_memset() include/linux/scatterlist.h | 12 +++ lib/scatterlist.c | 204 +++++++++++++++++++++++++++++++++++- 2 files changed, 213 insertions(+), 3 deletions(-) -- 2.25.1 *** BLURB HERE *** Douglas Gilbert (4): sgl_alloc_order: remove 4 GiB limit, sgl_free() warning scatterlist: add sgl_copy_sgl() function scatterlist: add sgl_compare_sgl() function scatterlist: add sgl_memset() include/linux/scatterlist.h | 12 +++ lib/scatterlist.c | 185 +++++++++++++++++++++++++++++++++++- 2 files changed, 194 insertions(+), 3 deletions(-) -- 2.25.1