From patchwork Mon Jun 13 08:28:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12879163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C6A2C433EF for ; Mon, 13 Jun 2022 08:28:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13B2B6B0256; Mon, 13 Jun 2022 04:28:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 075EB6B0257; Mon, 13 Jun 2022 04:28:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E31AF6B0258; Mon, 13 Jun 2022 04:28:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CD4CB6B0256 for ; Mon, 13 Jun 2022 04:28:11 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9EE723539E for ; Mon, 13 Jun 2022 08:28:11 +0000 (UTC) X-FDA: 79572535182.14.D9ABCAF Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf20.hostedemail.com (Postfix) with ESMTP id 378501C007A for ; Mon, 13 Jun 2022 08:28:11 +0000 (UTC) Received: by mail-pl1-f181.google.com with SMTP id f9so4546241plg.0 for ; Mon, 13 Jun 2022 01:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZkbtHcgR5KA0zD+x9oTUHYVWwacT9VRypGcZ4wLZpOg=; b=TgHg0MUizrXjDF8ad/OqkO0qwgk0KXix4D6xsPRARVAZQlAAVWz859Q5ieKtHCft7k owKsPdbZEYtxyqYnHeIU8IAIdCNROBeYACaOkl4nTS6uw/qiohVmL9V9uZH5xuikS3NX PEStaXJRZSd/GQq4pxH8f4CRA4aaZEi55S070= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZkbtHcgR5KA0zD+x9oTUHYVWwacT9VRypGcZ4wLZpOg=; b=odmn/++JTVrSu3GcfSmi6MqvKoHWqVLnaSuIAF97ehmMlZg+W2vH+JPZwNCw5VjYI8 Vau3OA+hL5qq3m3IXstWw5coys5vE1zWKNH8ALDeK/1mrbSwBzbUOQuNsRyYdebkwlZr fVIO+vFbbyHL4JSJw2eswEXYGJ/ojWCFkAvh6Po8ujvzVt30yq6RFcwJ9eWfSlWhmtTv zuCeWKq8E4Jhu/IAxrJfRJEES5kdLcKtqiyplcGZ1T/uSXRa/Xlgl3oZdKoiMWaB/ktW CECSsltqOQFqxWFKbhEqkHYZuoGFTgAzTw2K3lT96A2RzSF3wrtgaL3FBD3UW/28y8bA bPcA== X-Gm-Message-State: AOAM532t9JlgdDVfC8uPu0i3oYtFdQCU4pdfFUz9QezVTi8VRV4PpTdU I7iyr2WYPI1Yj/XPXTuGpCKv66XXdEbAAQ== X-Google-Smtp-Source: ABdhPJwi2SCEgGhZ9I5onX8/zOrE1DLMbnkSlLcyHUO6ndmNQT89+0bno1W9+WZ49cCJAUst7NqxuA== X-Received: by 2002:a17:90b:1192:b0:1e2:da25:4095 with SMTP id gk18-20020a17090b119200b001e2da254095mr14274601pjb.240.1655108890190; Mon, 13 Jun 2022 01:28:10 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:79ca:e1d9:ad5:dc9e]) by smtp.gmail.com with ESMTPSA id br8-20020a056a00440800b00518a473265csm4624906pfb.217.2022.06.13.01.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 01:28:09 -0700 (PDT) From: Hsin-Yi Wang To: Phillip Lougher , Matthew Wilcox , Marek Szyprowski , Andrew Morton Cc: Xiongwei Song , Zheng Liang , Zhang Yi , Hou Tao , Miao Xie , "linux-mm @ kvack . org" , "squashfs-devel @ lists . sourceforge . net" , linux-kernel@vger.kernel.org Subject: [PATCH v6 1/3] Revert "squashfs: provide backing_dev_info in order to disable read-ahead" Date: Mon, 13 Jun 2022 16:28:00 +0800 Message-Id: <20220613082802.1301238-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220613082802.1301238-1-hsinyi@chromium.org> References: <20220613082802.1301238-1-hsinyi@chromium.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655108891; a=rsa-sha256; cv=none; b=fA6YblURM/+yxjZAqbiV+wWS/hcpptMRIV2F8xoG2wxsEYjvugCCdLjj32+pqAISElZ8Qv U+WnjYjFSfLE//gv0gUjNgEesLxo35mW+HHED5w8dT1naYNKOyMXBIWufPIvheYIpinUWV wqUc8/nRPj7aoPXqWGKtgH8djBG2tTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655108891; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZkbtHcgR5KA0zD+x9oTUHYVWwacT9VRypGcZ4wLZpOg=; b=DW6+1laE45TZFRWNJOxmL/iJCE7VwOMhgGeRxaBi+ePXfQhH4ojLGziu3VxhTRXPOgyNCD 4ZfMosJG4TgmizoXSU5xTiFoDFNLTsYM1LYPFL94vr5RbPvkB0j6FU2j7fjcI4ccKzZKC1 7j538vTuXLWu0onivj+aKcGXBoXGMms= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=TgHg0MUi; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf20.hostedemail.com: domain of hsinyi@chromium.org designates 209.85.214.181 as permitted sender) smtp.mailfrom=hsinyi@chromium.org Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=TgHg0MUi; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf20.hostedemail.com: domain of hsinyi@chromium.org designates 209.85.214.181 as permitted sender) smtp.mailfrom=hsinyi@chromium.org X-Stat-Signature: 5qzxfxyk1h83i8tmznbmztfzm58gjwhh X-Rspamd-Queue-Id: 378501C007A X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1655108891-484523 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This reverts commit 9eec1d897139e5de287af5d559a02b811b844d82. Revert closing the readahead to squashfs since the readahead callback for squashfs is implemented. Suggested-by: Xiongwei Song Signed-off-by: Hsin-Yi Wang --- fs/squashfs/super.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 6d594ba2ed28f..32565dafa7f3b 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "squashfs_fs.h" #include "squashfs_fs_sb.h" @@ -113,24 +112,6 @@ static const struct squashfs_decompressor *supported_squashfs_filesystem( return decompressor; } -static int squashfs_bdi_init(struct super_block *sb) -{ - int err; - unsigned int major = MAJOR(sb->s_dev); - unsigned int minor = MINOR(sb->s_dev); - - bdi_put(sb->s_bdi); - sb->s_bdi = &noop_backing_dev_info; - - err = super_setup_bdi_name(sb, "squashfs_%u_%u", major, minor); - if (err) - return err; - - sb->s_bdi->ra_pages = 0; - sb->s_bdi->io_pages = 0; - - return 0; -} static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) { @@ -146,20 +127,6 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) TRACE("Entered squashfs_fill_superblock\n"); - /* - * squashfs provides 'backing_dev_info' in order to disable read-ahead. For - * squashfs, I/O is not deferred, it is done immediately in read_folio, - * which means the user would always have to wait their own I/O. So the effect - * of readahead is very weak for squashfs. squashfs_bdi_init will set - * sb->s_bdi->ra_pages and sb->s_bdi->io_pages to 0 and close readahead for - * squashfs. - */ - err = squashfs_bdi_init(sb); - if (err) { - errorf(fc, "squashfs init bdi failed"); - return err; - } - sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL); if (sb->s_fs_info == NULL) { ERROR("Failed to allocate squashfs_sb_info\n");