Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp909746ybx; Wed, 30 Oct 2019 07:05:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwernR0EOSxy5Ax/RJFCjf5swulFnV3/4YHO6CrSn9C8tjLfylTZkHjX/z+8EjQMbyzUbU X-Received: by 2002:a17:906:1dc4:: with SMTP id v4mr8999212ejh.248.1572444349557; Wed, 30 Oct 2019 07:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572444349; cv=none; d=google.com; s=arc-20160816; b=KDvY3hQHXCUlNuHp5MxA644RziI2rB83/ciamnZbRSoC8vOfca1Rgws0V0ArtLR+b2 48jTE29yvGjUZQRObkfGdJXEWCtr8lZgQ+liD5MWspnfxtjA7VE2W3EMSc5R5bHw0FmJ qUDHNPQ4G2Fx5sSfFVX+7FiDwYLTAEJX0va6R1pDOSl9yVqWCCkUYCy3oriL1GCiEoWW vcfraoY+1tGKy1ObOXN1cDGN5itRTzI4eatEC2SuHywZnpN8i9jEYPwSt/wdYv7SBteD y5LdrO5UPkk7p1NNkSFndM6uU5dtNhEGq/eSxUGZ9Nu137O0MQe2YuMcFC/tBIk6Uf25 NJ8Q== 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; bh=TfYdftZv+XvQk6lERRs+7IY3b2jFdRYpMEBvfeSBkFI=; b=OmDcbkKyEN72v4tcr+Mtun7opDrUP0gcBE8VgtCTSC6CyViMFBLFnLJTOXOvLqw4Pv upoP1v7bUYiGHoYUgsXnf0+Hz/wsXUkv2lfDyNEiDBEEulbaS+UMxp33BIVnCLo81Lnn OsuGqhp4I5rB9LFpoOhXGiG3hjtEOT/0nEHIxouoFZAK3gw9lNEmgWJPxOVGvWNilyev 1hFwnAc7J28zfM6mxmGboI6OvHwnmd4hPy7K1qWg/3Jmo7xlzgYrbbddiJLVryDs/vqU +3VZ91AN1VkpSIQKeMSsZz4Kd760/9/2FHJv/sUpXWNOvczmHPd0uwD775NSPg00c2Xy /TmA== ARC-Authentication-Results: i=1; mx.google.com; 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 3si1744680edw.274.2019.10.30.07.05.24; Wed, 30 Oct 2019 07:05:49 -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; 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 S1726710AbfJ3OBr (ORCPT + 99 others); Wed, 30 Oct 2019 10:01:47 -0400 Received: from verein.lst.de ([213.95.11.211]:45652 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbfJ3OBr (ORCPT ); Wed, 30 Oct 2019 10:01:47 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 3882E68B05; Wed, 30 Oct 2019 15:01:44 +0100 (CET) Date: Wed, 30 Oct 2019 15:01:44 +0100 From: Christoph Hellwig To: Philippe Liard Cc: phillip@squashfs.org.uk, hch@lst.de, linux-kernel@vger.kernel.org, groeck@chromium.org Subject: Re: [PATCH] squashfs: Migrate from ll_rw_block usage to BIO Message-ID: <20191030140144.GA14098@lst.de> References: <20191029074939.GA18999@lst.de> <20191030011954.60006-1-pliard@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191030011954.60006-1-pliard@google.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 30, 2019 at 10:19:54AM +0900, Philippe Liard wrote: > > What access do you need to synchronize? If you read data into the > > page cache the page lock provides all synchronization needed. If > > you just read into decrompression buffers there probably is no need > > for synchronization at all as each buffer is only accessed by one > > thread at a time. > My main concern here was waiting for the BIO request to complete but > submit_bio_wait() that you pointed out below should address that. Note that if you are doing multiple bios for a single request using submit_bio_wait might not be optimal. In that case you probably want a refcount and only complete when all of them are done, but by looking at submit_bio_wait should get an idea how that works. Alternatively look at others users, e.g. __blkdev_direct_IO in fs/block_dev.c that already support multiple bios.