From patchwork Thu Sep 15 09:42:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12977127 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 54888C6FA86 for ; Thu, 15 Sep 2022 09:42:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 539CA6B0078; Thu, 15 Sep 2022 05:42:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3610B6B007B; Thu, 15 Sep 2022 05:42:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F8286B0078; Thu, 15 Sep 2022 05:42:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D9CDD6B007B for ; Thu, 15 Sep 2022 05:42:24 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B9D77120CE8 for ; Thu, 15 Sep 2022 09:42:24 +0000 (UTC) X-FDA: 79913829408.25.5E7E629 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf05.hostedemail.com (Postfix) with ESMTP id 6D2BA1000B3 for ; Thu, 15 Sep 2022 09:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=PzlrQ8oKvfWNjDBiduvx+RzNOBIgqE2Y/9GDFrAa5zA=; b=bXeNhFFDCpfkRWHXmWzdHwlB5U ebzGk7+4exPACeou4fI+Sm6JQFfbX33mPhr7e+OY/vsBOl+7KB4pjS4bZIZmQBKspIrcU6Do7JYgB H66JJ5LEpcNzjlgpmde8OXP0YN93isg92RFIGpYP4eIsiAM2zsRgJ64ui9RH8ZXVhVfDu0YBFF3LE M5dml3Id3wks6W5Ui9PYxUv0W0G0mv5pIbLUdioFpLJQdNk+eUZyJq95PBmrV2Ra3D8ir74eOeDfy DZdcZFhb46yvO66ykAJ0TjIXLo+uKG2Nxo+zFLhSQr8Qeiaf7+ctmRj1h1E2s4mnsAnzj/LV9UNQv 0kRBcInw==; Received: from [185.122.133.20] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYlNu-005b8U-Qp; Thu, 15 Sep 2022 09:42:15 +0000 From: Christoph Hellwig To: Jens Axboe , Matthew Wilcox , Johannes Weiner , Suren Baghdasaryan , Andrew Morton Cc: Chris Mason , Josef Bacik , David Sterba , Gao Xiang , Chao Yu , linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-mm@kvack.org Subject: [PATCH 5/5] block: remove PSI accounting from the bio layer Date: Thu, 15 Sep 2022 10:42:00 +0100 Message-Id: <20220915094200.139713-6-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220915094200.139713-1-hch@lst.de> References: <20220915094200.139713-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663234944; 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=PzlrQ8oKvfWNjDBiduvx+RzNOBIgqE2Y/9GDFrAa5zA=; b=TNeJThbDxNtzbHGw3TJuzcmA0tb49sUlNfv/5nMDRY799z2Ol8QW4Uh+3V6hMT+0wW82Ob rPELzs0mQnnTBr7JNJpWIQl8brIkq8+3ceqtIvL699bXmQB1Da0qgUN6/Jl+TxfR43haPF ejVfVXlenavrf/Zt8GZN1umiDtRS7yw= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=bXeNhFFD; dmarc=none; spf=none (imf05.hostedemail.com: domain of BATV+aa90abf7a61f323a8d2f+6962+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+aa90abf7a61f323a8d2f+6962+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663234944; a=rsa-sha256; cv=none; b=CfJONRaHQik5VwbvHH6C1CTtfakehJMmzkp4NY5UVvfq28tnXBJ0z50rh2bAPAC7NzaYz0 GFA3n8ZnQYk4gJAHDgel5Y+i2wnVEx7paWEzq9d0dAZrpT9SaSso2+XQRVW6FFC2RxPiWS T7Uuu6l7Y2wE9PYLQVJMbPRnRLfsG+U= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6D2BA1000B3 X-Rspam-User: X-Stat-Signature: gmqs1wwtk84rtfpfay7u8geeps1ty6ut Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=bXeNhFFD; dmarc=none; spf=none (imf05.hostedemail.com: domain of BATV+aa90abf7a61f323a8d2f+6962+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+aa90abf7a61f323a8d2f+6962+infradead.org+hch@bombadil.srs.infradead.org X-HE-Tag: 1663234944-16612 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: PSI accounting is now done by the VM code, where it should have been since the beginning. Signed-off-by: Christoph Hellwig Acked-by: Johannes Weiner --- block/bio.c | 8 -------- block/blk-core.c | 17 ----------------- fs/direct-io.c | 2 -- include/linux/blk_types.h | 1 - 4 files changed, 28 deletions(-) diff --git a/block/bio.c b/block/bio.c index 3d3a2678fea25..d10c4e888cdcf 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1065,9 +1065,6 @@ void __bio_add_page(struct bio *bio, struct page *page, bio->bi_iter.bi_size += len; bio->bi_vcnt++; - - if (!bio_flagged(bio, BIO_WORKINGSET) && unlikely(PageWorkingset(page))) - bio_set_flag(bio, BIO_WORKINGSET); } EXPORT_SYMBOL_GPL(__bio_add_page); @@ -1276,9 +1273,6 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) * fit into the bio, or are requested in @iter, whatever is smaller. If * MM encounters an error pinning the requested pages, it stops. Error * is returned only if 0 pages could be pinned. - * - * It's intended for direct IO, so doesn't do PSI tracking, the caller is - * responsible for setting BIO_WORKINGSET if necessary. */ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) { @@ -1294,8 +1288,6 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) ret = __bio_iov_iter_get_pages(bio, iter); } while (!ret && iov_iter_count(iter) && !bio_full(bio, 0)); - /* don't account direct I/O as memory stall */ - bio_clear_flag(bio, BIO_WORKINGSET); return bio->bi_vcnt ? 0 : ret; } EXPORT_SYMBOL_GPL(bio_iov_iter_get_pages); diff --git a/block/blk-core.c b/block/blk-core.c index a0d1104c5590c..9e19195af6f5b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -829,22 +828,6 @@ void submit_bio(struct bio *bio) count_vm_events(PGPGOUT, bio_sectors(bio)); } - /* - * If we're reading data that is part of the userspace workingset, count - * submission time as memory stall. When the device is congested, or - * the submitting cgroup IO-throttled, submission can be a significant - * part of overall IO time. - */ - if (unlikely(bio_op(bio) == REQ_OP_READ && - bio_flagged(bio, BIO_WORKINGSET))) { - unsigned long pflags; - - psi_memstall_enter(&pflags); - submit_bio_noacct(bio); - psi_memstall_leave(&pflags); - return; - } - submit_bio_noacct(bio); } EXPORT_SYMBOL(submit_bio); diff --git a/fs/direct-io.c b/fs/direct-io.c index f669163d5860f..03d381377ae10 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -421,8 +421,6 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) unsigned long flags; bio->bi_private = dio; - /* don't account direct I/O as memory stall */ - bio_clear_flag(bio, BIO_WORKINGSET); spin_lock_irqsave(&dio->bio_lock, flags); dio->refcount++; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 1ef99790f6ed3..8b1858df21752 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -321,7 +321,6 @@ enum { BIO_NO_PAGE_REF, /* don't put release vec pages */ BIO_CLONED, /* doesn't own data */ BIO_BOUNCED, /* bio is a bounce bio */ - BIO_WORKINGSET, /* contains userspace workingset pages */ BIO_QUIET, /* Make BIO Quiet */ BIO_CHAIN, /* chained bio, ->bi_remaining in effect */ BIO_REFFED, /* bio has elevated ->bi_cnt */