Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp952542ybl; Fri, 30 Aug 2019 09:29:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKT4EjYg/RXYhynSthQdi45alGTCkb26wTHnqrAxyHegO7gkBYzFoCjBw138YGwrYiGKuK X-Received: by 2002:a17:902:8345:: with SMTP id z5mr17365991pln.29.1567182571854; Fri, 30 Aug 2019 09:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567182571; cv=none; d=google.com; s=arc-20160816; b=roYDCeT1NSgyFATfIS2gdBTkKMGwmkvSAhPIJDCtzPMMmzNdqrGC3ukQXdX/k+KVeq 285gifOrq7ile6vClne1iyA/Z8K1vXyNQF7CRJF+run4lKONCh3F1vBqjYhO1XmoMpzT Wr342eleK5W2JCUvPC7id4BXlP8R7nNi71z8+UUoBT8nMjg7jvjzK/UPq7L3uMNKHv7G L/2LUw4MDqNcLzbw1mq08IABShpx5EhQkvMee1M9Rb78VRx+C2xc/vcFP7yjMIskcdfZ Ue8eXsh9BTgWAPP/9ndCHWf0RdQT8yHZD8K6ncgoCXTZg1SQJ5pnPYEx5nDeNBILQcZO NLCA== 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=RdPMpAXXBaiQno2G62m49MFypxqlVKUtgB8faAoi/bA=; b=CZ38gUbKLp41rs8wRCSA+CEv6UiuUwl6wXP6JyuWdgS0SLpXHBbZfT7m8YQI6aKEVq Namyh54MDmcTGOMzq375OqaleTrDOCFTjoaZ9E2xys4QQEV0zvnffHDy7Q/mxNFsAz2d ywdjgHwRojRdQTlzAB9VsqiTWaWqKkvpkZIGxRcHwD15ovnzdlMwGw1rH3kjjAEgSqPV Q3PW+Ha+OLwSa8xDIiFsDUMJJhGAT5Zdfgqjq37mR9gHOcxEfDsEu7W/GMsIAs09HgSG EowPnnDZhraiRPrY5FzTlGFA8CgTY5WoCDJcU9a0KrCI4WqR3oiY9ILqeh4VjgXDAayq M80g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m0ltjgx7; 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 e13si4872765pgs.275.2019.08.30.09.29.15; Fri, 30 Aug 2019 09:29:31 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m0ltjgx7; 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 S1727945AbfH3Q2R (ORCPT + 99 others); Fri, 30 Aug 2019 12:28:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45450 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbfH3Q2R (ORCPT ); Fri, 30 Aug 2019 12:28:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RdPMpAXXBaiQno2G62m49MFypxqlVKUtgB8faAoi/bA=; b=m0ltjgx7t4ynixYMj9EPQrDSd gouxhmamQQK46+oauBJCwjtVgtNnrQh3DY23q1oViqIYVv0QTxvU8EoQ2QX088A3jt8it37QT5tav +G99U5Hvmr8MWiuaitu6f4u0/16jw6KiM7gZ1aQphmP3iwQ4Ep8Ka7z0Z1hi8dRKhi7TrUA50F4rN 6tsT6WTOz8bN8V7WcePdcW6dl7pBthWt1CXoQ36kayghdBUUFC2rvbk2mlhO/aFNG+K6fyaE5nxxt s8RKesu5J5MzBXL4CN/QjwpPqfrgUu3acD8Zy1p3mVZi/IUFVrm/eTTNm+BVfU3APEHcq1XOQIYIO cSh/4TjEA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i3jky-0006Lt-Fu; Fri, 30 Aug 2019 16:28:12 +0000 Date: Fri, 30 Aug 2019 09:28:12 -0700 From: Christoph Hellwig To: Gao Xiang Cc: Chao Yu , Dan Carpenter , Christoph Hellwig , Joe Perches , Greg Kroah-Hartman , devel@driverdev.osuosl.org, LKML , linux-erofs@lists.ozlabs.org, Chao Yu , Miao Xie , weidu.du@huawei.com, Fang Wei Subject: Re: [PATCH v3 7/7] erofs: redundant assignment in __erofs_get_meta_page() Message-ID: <20190830162812.GA10694@infradead.org> References: <20190830032006.GA20217@architecture4> <20190830033643.51019-1-gaoxiang25@huawei.com> <20190830033643.51019-7-gaoxiang25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190830033643.51019-7-gaoxiang25@huawei.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - err = bio_add_page(bio, page, PAGE_SIZE, 0); > - if (err != PAGE_SIZE) { > + if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) { > err = -EFAULT; > goto err_out; > } This patch looks like an improvement. But looking at that whole area just makes me cringe. Why is there __erofs_get_meta_page with the two weird booleans instead of a single erofs_get_meta_page that gets and gfp_t for additional flags and an unsigned int for additional bio op flags. Why do need ioprio support to start with? Seeing that in a new fs look kinda odd. Do you have benchmarks that show the difference? That function then calls erofs_grab_bio, which tries to handle a bio_alloc failure, except that the function will not actually fail due the mempool backing it. It also seems like and awfully huge function to inline. Why is there __submit_bio which really just obsfucates what is going on? Also why is __submit_bio using bio_set_op_attrs instead of opencode it as the comment right next to it asks you to? Also I really don't understand why you can't just use read_cache_page or even read_cache_page_gfp instead of __erofs_get_meta_page. That function is a whole lot of duplication of functionality shared by a lot of other file systems.