Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3313190pxu; Tue, 15 Dec 2020 04:09:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGaEtKaVnmMfPtXza9uYo25uvcdkv5MRS20befgHaF+epr9bZOL1lrLWPij0sPM0ITnCVJ X-Received: by 2002:a17:906:298c:: with SMTP id x12mr26459295eje.244.1608034194488; Tue, 15 Dec 2020 04:09:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608034194; cv=none; d=google.com; s=arc-20160816; b=N0wQ4Pghp/dxfKFzbByL6WMZiq9a6gJfnI0RJy4mYWDQNMQQory78Cnvm3HBKHY0PY NgZvMNNxLxYI7T6kd2vFIMGIXq/MTfNDiLHRFD3d8K/VOjoJFAIx2CKdpmpwsd1Yyg6v 6Ud+K0SUItM9fbfK+oidLcgBHp2dorYlyLSqmVpFcZQHxjx7gCjeBsX1t7vHZF7ahMiT J0cySBki25Dvh2xn2G5z57+qpqXJveGpzcTJtrn14maGKS0ZDF6YBtjlsAaDyMsnwcgf 6JcCK2FB8iuvmnPH+SOXQuCAH/bUFqunRRfgNt3WGmKX8uFU/vCLrAGr4nLs7KxSqfdA E2NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BMM7E9TuXF5eeNr/08yqebR2Dt2ctyis2zH1H/npDvk=; b=KcAM0eyFhX0Vi3goz9IEB1H+Onim/tVTy3zmG2plRVZiF9UQI3v9pW6SgthspQ3EJV 9K/+e2Ai2JODILcPBOle6ECQGedUHG05FfexKsve3+0ZbmmSVZ2+78TuYSKDNkXd5M6c KNOD2HEjNHBNqhDOdz3cyuEHL9Tkqy0bGodOjLOzifwlLID1nbG+xaug5Ays4JScXXJs GEJrrbgMbDCpCIrKKKOHHAI3clfGzerCi3HOQ+UVlrFnqtcJ46aWDqxXcQ4oJk8dEcMS hn0A8O+rcrkN3ErQYlluP8zNtRQ9uP10DtPaItUFHxfRw4ZDbwv4D3348uvYe3QV7ofr AK7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K7+s+Knf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si725488edw.280.2020.12.15.04.09.31; Tue, 15 Dec 2020 04:09:54 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K7+s+Knf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729158AbgLOMGa (ORCPT + 99 others); Tue, 15 Dec 2020 07:06:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47306 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728998AbgLOMFr (ORCPT ); Tue, 15 Dec 2020 07:05:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608033860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BMM7E9TuXF5eeNr/08yqebR2Dt2ctyis2zH1H/npDvk=; b=K7+s+KnfBo4v9RnmU7i3mMOiTvTMfyQizYKVn1tFt2R5mY2j+JKP9zUoVK9P+yvR2ViePZ 9U1c8BKx7wHGYu+a0aaetZUJL36W3LafwkNVp7y/1AbR8BjDyTjNgG4MSnlwg/49QTNXCD HWJyaAOCWKmA3rBs0nCvjDoZ+AYOZ4w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-YS-IJu5KMfS3eRNExERwJw-1; Tue, 15 Dec 2020 07:04:16 -0500 X-MC-Unique: YS-IJu5KMfS3eRNExERwJw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 551CF180A096; Tue, 15 Dec 2020 12:04:14 +0000 (UTC) Received: from T590 (ovpn-12-182.pek2.redhat.com [10.72.12.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40F5019C44; Tue, 15 Dec 2020 12:04:01 +0000 (UTC) Date: Tue, 15 Dec 2020 20:03:57 +0800 From: Ming Lei To: Pavel Begunkov Cc: linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Matthew Wilcox , Johannes Weiner , Alexander Viro , "Darrick J . Wong" , "Martin K . Petersen" , Jonathan Corbet , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, target-devel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v1 0/6] no-copy bvec Message-ID: <20201215120357.GA1798021@T590> References: <20201215014114.GA1777020@T590> <103235c1-e7d0-0b55-65d0-013d1a09304e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <103235c1-e7d0-0b55-65d0-013d1a09304e@gmail.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 11:14:20AM +0000, Pavel Begunkov wrote: > On 15/12/2020 01:41, Ming Lei wrote: > > On Tue, Dec 15, 2020 at 12:20:19AM +0000, Pavel Begunkov wrote: > >> Instead of creating a full copy of iter->bvec into bio in direct I/O, > >> the patchset makes use of the one provided. It changes semantics and > >> obliges users of asynchronous kiocb to track bvec lifetime, and [1/6] > >> converts the only place that doesn't. > > > > Just think of one corner case: iov_iter(BVEC) may pass bvec table with zero > > length bvec, which may not be supported by block layer or driver, so > > this patchset has to address this case first. > > The easiest for me would be to fallback to copy if there are zero bvecs, > e.g. finding such during iov_iter_alignment(), but do we know from where > zero bvecs can came? As it's internals we may want to forbid them if > there is not too much hassle. You may find clue from the following link: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2262077.html Thanks, Ming