Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2895330ybi; Thu, 18 Jul 2019 16:45:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgIJtW+3ImsUAsxgEDN/4eXWcCvfFjShUBc5yAWqK7m8jzqVJMsqiwdHNsOBRY5aPZ6Nmb X-Received: by 2002:a17:90a:8984:: with SMTP id v4mr53871402pjn.133.1563493548910; Thu, 18 Jul 2019 16:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563493548; cv=none; d=google.com; s=arc-20160816; b=I0oXG0m7qacn9kvrwjQtOaYwFkXqGc6FaaI9V3vWfvT9td/dcvnfxw4lLqP3RvJFIR lgLCObgnouzWoSrSDH2aBtWlM8z3jM0ZTG95fkOFRVdPEIf4fx7djOkOxe7bhOc8K1nK gJ2pYFlUMp5sWaURrwf+80SOMnnWFIpByuPJ0SSKBmxG/XvMaHnSXxT8/kRWzg80OBuA uvogJQArEXkE/PCUDHE+7Mg2YRIGEhwJcRG1zoXx0Nr4BaGmt8H9T1WSAhSz/MQZtHxt Hbw9IW6IOgdSMOtDxCiRcsvZNkfs+C+LzqDhbKcZwkT5INkB8sp7BdHHz9C0QmIXwkd2 HETg== 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:dkim-signature; bh=MQwS96V3LHC/Rllb6kfS8urt8Dwxl4rqynJ2jowTCiU=; b=pslMxlHB7xa0V8p2WMWlPMj4csOTPjHv/ew/8PTlAZQZV9A0AttimBUjKZOq5PuIiw edNb/0zVQEwxoUSjGB2zp1TEH4D8e+aI2ALszwPwG4nfCbgCWGEogPoiiGq/exCsD+Ss Bz/H3XV+pcN91jsuzcC+dHkViITFRSN0bV9rqBCR2cCUGZzn4q4e6FD/j812TKKChhmX UQr5GdEBT5yDB0K1+B5TZwaCR8/xHs0RNrUJ8LlSLFw2t8x1PsrVRHKbMkIc6jVt46fm Dgb+98B48vgyTFUbDmvmwavnMKM12v5pBwsRduG1grGFz8A111o0vW0BpSKgY8SrSZ2M mcBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CbKqei8C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si450851pgr.277.2019.07.18.16.45.31; Thu, 18 Jul 2019 16:45:48 -0700 (PDT) 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=@linaro.org header.s=google header.b=CbKqei8C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726092AbfGRXn4 (ORCPT + 99 others); Thu, 18 Jul 2019 19:43:56 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43990 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfGRXnz (ORCPT ); Thu, 18 Jul 2019 19:43:55 -0400 Received: by mail-pf1-f196.google.com with SMTP id i189so13319454pfg.10 for ; Thu, 18 Jul 2019 16:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MQwS96V3LHC/Rllb6kfS8urt8Dwxl4rqynJ2jowTCiU=; b=CbKqei8CHSTARxahiWTl1FNQCrYm6g/pivGuc6BHyoNtkefajUa5vaq98Ltbgg5oxs 1JpjsDap9F5JWR+W3YAdGvvK6FJhByZfrrb2Bx9j947sJQg6HoFNYJhRuNH7wR6PqeaK 3Hq7SW/khR68/fak2pme92Si/S8q94ZaUWGRQDIt8/Xcy6WzQdTk2haBDcUFslzRTIzg plFUbL7NRAO2G1hnMye5xRiJbk3Jr6HJTkCYK3KY/ghz3Sbvuu0/LfZgtprRmRrYLJ43 r66L/8sYbUtlbXwNQcLT1hK6zStKv9lu3TuE5TF6WPH0pUqIczffKZTZ0RvkvBcIA2zS bi5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MQwS96V3LHC/Rllb6kfS8urt8Dwxl4rqynJ2jowTCiU=; b=bwXyPF5GhroqKJ1s0yiStMAP0lmMVE6QwV1WRKvcFkiIy2fixEsJ63JFcZaeFZ5UEy ISVKfoPEY4E1ttrFb+U0ryBW7fgdKPcbR0X8YKV7uC+SRWufCB3o6jT1+8VdYHlWFj9g ArvioHWMrg8ogkGvJgynSC4G9lHhYPJVsTiAQmyQ662l3FRwrdku9qSRl03ozXUcZ/Z5 iLS2IQ7Rb0j23Z6WMrJMuatXadvisVCAb63zaXDsp1kS0UR8WhZV7k+bHOHhO1kDzFSU bdmMVSGRXhzK+NFwvuAb8NpRF/CQCuv8QKV39JJaXzxYBSgR86XD8dSfuEcaS/Ynic1Z 6IhQ== X-Gm-Message-State: APjAAAU3ifKKjIcDfpKaWTtEhl3DIb3gcApd1RyjKq02Bwqq3Ofn0MXs ONDr9nvvcIHw8EbAC8RBfxeeEQ== X-Received: by 2002:a17:90a:db42:: with SMTP id u2mr54275822pjx.48.1563493435068; Thu, 18 Jul 2019 16:43:55 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id h6sm26955305pfb.20.2019.07.18.16.43.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 18 Jul 2019 16:43:54 -0700 (PDT) Date: Thu, 18 Jul 2019 16:43:52 -0700 From: Bjorn Andersson To: Al Viro Cc: Benjamin LaHaise , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] aio: Support read/write with non-iter file-ops Message-ID: <20190718234352.GN30636@minitux> References: <20190718231054.8175-1-bjorn.andersson@linaro.org> <20190718231751.GV17978@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190718231751.GV17978@ZenIV.linux.org.uk> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 18 Jul 16:17 PDT 2019, Al Viro wrote: > On Thu, Jul 18, 2019 at 04:10:54PM -0700, Bjorn Andersson wrote: > > Implement a wrapper for aio_read()/write() to allow async IO on files > > not implementing the iter version of read/write, such as sysfs. This > > mimics how readv/writev uses non-iter ops in do_loop_readv_writev(). > > IDGI. How would that IO manage to be async? And what's the point > using aio in such situations in the first place? The point is that an application using aio to submit io operations on a set of files, can use the same mechanism to read/write files that happens to be implemented by driver only implementing read/write (not read_iter/write_iter) in the registered file_operations struct, such as kernfs. In this particular case I have a sysfs file that is accessing hardware and hence will block for a while and using this patch I can io_submit() a write and handle the completion of this in my normal event loop. Each individual io operation will be just as synchronous as the current iter-based mechanism - for the drivers that implement that. Regards, Bjorn