Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4124040ybg; Tue, 29 Oct 2019 02:28:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVtkghgmK2hoVIPoz+Ub5vb/DgpmLqe9sihsxjOc0lldJ0AQ3SWLL0I+Poe2uj4/N9SWT6 X-Received: by 2002:a05:6402:20c:: with SMTP id t12mr24578721edv.109.1572341335615; Tue, 29 Oct 2019 02:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572341335; cv=none; d=google.com; s=arc-20160816; b=WtWDUQc9UZn5XxkJ76+sVtJ7xBcLZBdHPr11a4mn5pL1smDBWw7uftt8Pi7VOZhFdg jcZdcDGOO4hR+2vFbYE3FfjHfomP9Uk6SMhr7ys77VcMmm9kNkT9kAb9Ry3VSU6/Gqs/ yHEfZNxDl0gw4zzvwxeaQuYbA6EKoZjbBxAcD7arXxZZJwJEvify5HHEdajBFZirRf6P Hzl5i0cObdAHeBAX1GhScguOt9eQC1oTPcmO5OhoSVnfHsvcUK8QdSBbIbzvYCvaAJ78 01rK2Pn7BmL6dFhsDlX9efyHNgT4oZiaRxUgTuIgoxqTPtm3ha980h5uuxnSvSrP3GO5 SNsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=czBj5iiyb2avkPaBBfY6a4eoR3k0n1KTRJeBk9+xohE=; b=uQWCWOvC9Fp8I2UFXZo3fQBoCztVSDe65CDJlaTVi+e26CBGnTccxvlCxmSL73SMFy Mg+q3Gul6FGByI1K0ogxhNjk4jc92ChR24+J9xLeyuYNjlh2zFneJQy0WxL1Rn+ZblWY OwDNJsjTIjZDmeQy80DY03+y2/3cW+wt98hlZCVPPx+jIytz1wl8widwr6HPcL3ARn6N bVUW8JAmgr05uB9k6OklYixet4HwGt818tbY452Smaum88BQ6nuiBvEQuxDo3JCF1NpX o24t9TCS0sR4MqLHm3BGafew3yDQfINVg3pqH4JtUZr6Jhd0s5zh5X2LQErwTjpYtA6F i3Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gxuiK8t7; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si6614873edf.36.2019.10.29.02.28.32; Tue, 29 Oct 2019 02:28:55 -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=@google.com header.s=20161025 header.b=gxuiK8t7; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727592AbfJ2EKU (ORCPT + 99 others); Tue, 29 Oct 2019 00:10:20 -0400 Received: from mail-pg1-f202.google.com ([209.85.215.202]:46323 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbfJ2EKU (ORCPT ); Tue, 29 Oct 2019 00:10:20 -0400 Received: by mail-pg1-f202.google.com with SMTP id 195so10103830pgc.13 for ; Mon, 28 Oct 2019 21:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=czBj5iiyb2avkPaBBfY6a4eoR3k0n1KTRJeBk9+xohE=; b=gxuiK8t7b1l9J+ede3Wdzp6UYjkJG581WVbXyHzn7x7V4xDTN3fzvf/yQVizPEVDom AOLhNYP7ghbMWKIAAUjYP606jeGf4vR2rnVuFbi45pomkT0tBHvhqGdJVb2YQqFufo/+ 3pgD/WHwbjQ2i9Q1+Lj01BhwpBCvJGqpTuTO4GR46BSbaoUkBVsAqMEYYJBzSDKxqSsH n7o3b992almzi3sbMQsIeoaxBy8l3s4EcwmJSMHCdzDVkSAlfHYM5ksGyWVP9G2znN2J p1La4c6RwgN9dzC3sag0z+CUnMtJdSDXDyjLJ7jx39xfGXagJM2FfczBEt53wo0xFxqz eBFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=czBj5iiyb2avkPaBBfY6a4eoR3k0n1KTRJeBk9+xohE=; b=VNNN7V3/luXVAgjR7/sJm4D2T5/zwg4Th6E/ypq/f57APtq3xUkaQj9SiLFmIEGJrX CsfoCoxhQs5xBYq+P5+l/62KYtJQc7l3Zlve/hopNEg+k3YVNC+p8JS1JYEusen+KCT0 FUMrBzt1p5CDr6SIs396RWDIE8neLwjdyHmEr8zGrqvPPjTQ22lANP10MLyr7qo2twXy cTCRK2XmDrNfgIHsRK5vRJR0gmUIPs5GP0JAlxgwuhGHeY/kwxDvlp5gIs1pqntpbdx/ UaTTxbxT9PSCh/7aLy2q+PY5uMaOuwliV9bSGzA2BPzfzE8VFdnEcGc6Vv8SQSSByi7i jOwA== X-Gm-Message-State: APjAAAWTs7HUhfgXX/t/HE8r2z9ttO/CjJxUMyQVvPEyHDAz3tFE1cWw 2VF2jwu1GLG6a1sWOitBfgpXq458wbw= X-Received: by 2002:a63:da04:: with SMTP id c4mr24123103pgh.172.1572322219069; Mon, 28 Oct 2019 21:10:19 -0700 (PDT) Date: Tue, 29 Oct 2019 13:10:13 +0900 In-Reply-To: <20191018010846.186484-1-pliard@google.com> Message-Id: <20191029041013.175636-1-pliard@google.com> Mime-Version: 1.0 References: <20191018010846.186484-1-pliard@google.com> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog Subject: Re: [PATCH] squashfs: Migrate from ll_rw_block usage to BIO From: Philippe Liard To: phillip@squashfs.org.uk, hch@lst.de Cc: linux-kernel@vger.kernel.org, groeck@chromium.org, pliard@google.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I don't see why you still need buffer_heads at all. Basically if > > you replace each of your allocated buffer heads with a simple page > > allocation the code will be much simpler (this version adds more > > than 100 lines of code!) and probaby still a bit faster as you > > don't need the squashfs_bio_request allocation either. > > Thanks Christoph for taking a look. I like the idea of simplifying > this if possible. I think I understand your suggestion in principle > but I'm not seeing a way to apply it here. Would it be possible for > you to be a little more specific? Let me try to explain this below. > > My admittedly limited understanding is that using BIO indirectly > requires buffer_head or an alternative including some > synchronization mechanism at least. > It's true that the bio_{alloc,add_page,submit}() functions don't > require passing a buffer_head. However because bio_submit() is > asynchronous AFAICT the client needs to use a synchronization > mechanism to wait for and notify the completion of the request which > buffer heads provide. This is achieved respectively by > wait_on_buffer() and {set,clear}_buffer_uptodate(). > > Another dependency on buffer heads is the fact that > squashfs_read_data() calls into other squashfs functions operating > on buffer heads outside this file. For example squashfs_decompress() > operates on a buffer_head array. > > Given that bio_submit() is asynchronous I'm also not seeing how the > squashfs_bio_request allocation can be removed? There can be > multiple BIO requests in flight each needing to carry some context > used on completion of the request. Christoph, do you still think this could be simplified as you suggested?