Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2683151ybg; Thu, 24 Oct 2019 13:30:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwr9h/1G+KBgu/lvEdP8Kl7lijEchCTRxXJiyB8yQC7KVzNtzAE2/fcRck5KNfF9gqATciN X-Received: by 2002:a17:907:4150:: with SMTP id od24mr28585ejb.135.1571949024498; Thu, 24 Oct 2019 13:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571949024; cv=none; d=google.com; s=arc-20160816; b=WFcWHTkc5HIQJ+94EpZ68/HnpYcZBIE/CeePh+4goWOvHChJgDJvjspQ4jny+J+MzY nbiZPoP6j9biFxHnePCbecgp4PwinyziLy7vmm2le8ADBXSUL90B32pcbH68zBiNL4w4 2M9zUHQhiZsEQsDu3FkVqAWcMes1oyTl05DcUuJmrpAd352zxxHuQ+9xAf+xLoSUbX1C GqqySGQSAnxvipC1vDN9MZBbN4KLzwDFTbFF1qvrw5BMbfCQipk11FnJeH6YCYvp7BIT BnWYTJJ6mZI76T0Wrxdca7R6iuZos5OIAbNPIgLRzgh03yYH7BeXr0uaMpl6PCNHcEhL BSTQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5GQIr7IaB9RS8gJWjgXdB8tkau2TC16X6XzdFwNy+0E=; b=rxTW5xGfTl9k90c+u6+Kf2DGoaTYVSPHGzr9JtgeQH35dzTbdntQ+gTaP+5QwUqW// ZFjCpUArD1xmJxO9gvsY8xsOJ1Na7Z4LUXwJMnnVxlthSMkLsQshXUI3pmsyYdiosqhZ 1GNbSIUzbuh7TXllxh5IyWsGN5++HwVBst0syHMrrXmlX1F0XDIEM+4chhsn/zsekKLA 2kLphmJh7/1tV0JJ7LPM4L90wExDfuDErM5W1NzgSfkjvGhSXDur1J0+95q48QlqUTtd xZaVPN43hf4kh8LzV63ZZaLU0OeR9RtDx6/DxeQPaRI8K2bq/jZDrgjVo0pHt1viYlQe jmaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=jm3cX1F0; 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=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si1656445edg.420.2019.10.24.13.30.00; Thu, 24 Oct 2019 13:30:24 -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=@aol.com header.s=a2048 header.b=jm3cX1F0; 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=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437543AbfJXFlb (ORCPT + 99 others); Thu, 24 Oct 2019 01:41:31 -0400 Received: from sonic315-8.consmr.mail.gq1.yahoo.com ([98.137.65.32]:36089 "EHLO sonic315-8.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406827AbfJXFlb (ORCPT ); Thu, 24 Oct 2019 01:41:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1571895689; bh=5GQIr7IaB9RS8gJWjgXdB8tkau2TC16X6XzdFwNy+0E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=jm3cX1F0hc5Qml2Eo44Ez0Yv29dHn2TRDUz/y7KNAACNYyppbcyujYjk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zQ9HdGP2CK4YTJVvM9DhtGHgMGIn9dLACw57dBUX1aQINi.TMTM1D JdV83TQQ6_lrZdpBM1SXdSzC17sEcNNAWxvVCQKXdiZbr7e6JwwcIS1QQXEAX8eZGLFogHm3fwdh l4FdX3UE0k7GDl5eouJ.uXP8j17g7OaWyOn_Sr38YA0JAZzgHbirLjPU6amZ06LbfSeI3yxU7RlB mwkaJ_40CXTi4CPNS0TOKImGGACtQCH31mlZqI1C4zeiLPZFANNO52bJEUhTAH04uGO1z2mMzsL6 3aDPzP_cbly2_CRWjXZ4K_8higo5YDs3BXQlwit9Mp2AvHxpLQHqzx_6GxcSF_ppKrABm6H4xOvo e.Ko218thoKcLivXkuAYkgXvSbBUKKXtYokNyEfxKN6PhfhcksqJs9_1a_j4ST_SW8XPatmiMXvw r_rVQ9MzoQD2.k6vKeZvKTuU5CQNHrBjq_RBBCc6phAz8AGNCX8FOBonR1Rzvs2UUOXJTszWFOSJ vm_l.uOSrbPug_DIVLL1XBN1SUjiffDzfWpv0VgdVgQHGu2M3DCtvsPK_Z1AOyrWb8hXyMd1VEXH 7YyCWsuaH9dOhTNhHuf_weBbxX2lVS17BQiSZb9Z6 Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Thu, 24 Oct 2019 05:41:29 +0000 Received: by smtp417.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 58468a67fe640e75d17c6286566093fa; Thu, 24 Oct 2019 05:41:25 +0000 (UTC) Date: Thu, 24 Oct 2019 13:41:15 +0800 From: Gao Xiang To: Philippe Liard Cc: phillip@squashfs.org.uk, linux-kernel@vger.kernel.org, groeck@chromium.org Subject: Re: [PATCH] squashfs: Migrate from ll_rw_block usage to BIO Message-ID: <20191024054112.GA1998@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20191018010846.186484-1-pliard@google.com> <20191024012354.105261-1-pliard@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191024012354.105261-1-pliard@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 24, 2019 at 10:23:54AM +0900, Philippe Liard wrote: > Thanks Cristoph 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. Personally speaking, just for Android related use cases, I'd suggest latest EROFS if you care more about system overall performance more than compression ratio, even https://lkml.org/lkml/2017/9/22/814 is applied (you can do benchmark), we did much efforts 3 years ago. And that is not only performance but noticable memory overhead (a lot of extra memory allocations) and heavy page cache thrashing in low memory scenarios (it's very common [1].) [1] https://linuxplumbersconf.org/event/4/contributions/404/attachments/326/550/Handling_memory_pressure_on_Android.pdf Thanks, Gao Xiang