Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp254800pxp; Wed, 9 Mar 2022 02:11:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvUCQPWsEgivCJlfz+KdalUUJaJZLTpHjSCGor/ZIoMT+2U5cBtVNRFTnLLx/+4iIlaw/i X-Received: by 2002:a63:8448:0:b0:373:a276:767 with SMTP id k69-20020a638448000000b00373a2760767mr11099318pgd.409.1646820695102; Wed, 09 Mar 2022 02:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646820695; cv=none; d=google.com; s=arc-20160816; b=xc4xG47bgLcdlNC/SeNtVm9PAm+VM3hFtOqmEAjDeCWKziO6F2ldMitCXQDgHxlDJI 0B0GPRNY5b1VNYqaoEZu2qLenXw7uSzbcCiiq0tpK87pS3OAK1Mr7NvgCK+3yPQVT5YE UK1DKB/1FAIrrokNzxYzDTqTndPQpZ51g+3i+raXH+7J5l5efIPrlDRYaB1UQ07ol2Ce UCwrodYMMpMyd76ji4z16z0ZcCCxEyMrjRGzV3vu8wxabezmG4Xei1IGkdj3p1/4/yPs 5029kQzcfSGf0oyBJcY8uDpdIGLT6Wb6Eq/dYGQj9soV/114pRGChnV1lt5J+FNU06Ms jTrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QJcsiCvuU0LEpDBG3YLrgQ6iZjq8OgfZ7I3Jt2iwnik=; b=RTN+6pUByEZHQNNr7zsVJJBXLYmtGiZwqfyFiuAS/JlK2lI0x0C5G/dolHr5bgbyN5 wufE3TP338VbNkcF5aTaE4YOvCu9R+4eX/k3mmZC64bL9kTJc6ACljzIIIyMn7W1S0h9 yl6D9jy3a5iW2RQkeVCFTnwKkFL65/12AoPZ72ufA5zkIpx9CWY5TbZapLW71uB+PRd1 SwP0NMuAByQbCh6unCuTxnrvDKSHykBZOMMhFCDoSXsLlZLGvGeGrA2Rf6FARSshHPJK 8b2FedPtzTpUXk5cYAiDlYoynw4N2C3JJKUxUXnUnGCR+ho/3FcUT2bbsnC+MY9Argdp 1odg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nTpovFHq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a170902d2c300b00151ef69c29esi1725333plc.49.2022.03.09.02.11.14; Wed, 09 Mar 2022 02:11:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nTpovFHq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232007AbiCIJpA (ORCPT + 99 others); Wed, 9 Mar 2022 04:45:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbiCIJo7 (ORCPT ); Wed, 9 Mar 2022 04:44:59 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04991151D34; Wed, 9 Mar 2022 01:44:01 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id 85so1253110qkm.9; Wed, 09 Mar 2022 01:44:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QJcsiCvuU0LEpDBG3YLrgQ6iZjq8OgfZ7I3Jt2iwnik=; b=nTpovFHqrUcu1YKcuKeMad3NEJIkWsFY4E1ZGaZ//DzOuXb+Hck7Et4RZVgZVhAs0X 6Y08wfQM6QYvyHqwC25iJp+tF+xc9F63LDowZuGLP5NYb00ZzhJMqj25x/XLhKknYwDj S9BFdw3xPSpBUmcFSA2TcnRrbsDs3wzleTmwDfKND8MGrZncr/Dk28KsaK8KROuiKnaO IotL5w88jCfOngXO3t1WKpldiiTqwjKj7JGhSOV1rLE7aJyYoQJ+O2e79NlBjHVShfeF TTcTAnduzWNdBtxEk8sA4bv75Eb/gXxWGtkD0c0x3hxSbHl1wsxGlO0s5er2psdjNNwm DuTA== 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:mime-version :content-transfer-encoding; bh=QJcsiCvuU0LEpDBG3YLrgQ6iZjq8OgfZ7I3Jt2iwnik=; b=4xEiJ+/axTysFsCMALrs+/GEfmzRdHP6z8jrQVe0DPmM1Cl56nRnVIgBmu6WeC94VH j43lD7grbepoav8QY/I4JXE6jmXJoslzM5rU70AbceddYgrON04M1FbzJeOyM+dgs6Gp p15yq7DuLwWGimJeJI+aqEinXH370FI2JanGDoKiTYPtVtSOAWdFz5NeRwPKyXtL4BX+ wTcgVjTXKiCiRVnKOsCLEoHR4XPnSwbf942gio3Em4iMl1uVgLqUUYAGP48GUh1JmqTm z0GLUNDuFIgjcTeM7X2YKTAJlv4Vni2NZEcZ3H9rKwFZ2F+jwN92Rpt5fogbMrK0+G20 zt5A== X-Gm-Message-State: AOAM531TkNsZM5R9z2kfXVAxejswYFSUALFMpNko5BGK3/jUJZRuLmxq 6cezB2tXJPTr6yYISD5Wxs4= X-Received: by 2002:a05:620a:14ab:b0:60d:d5cf:627a with SMTP id x11-20020a05620a14ab00b0060dd5cf627amr12731999qkj.103.1646819039769; Wed, 09 Mar 2022 01:43:59 -0800 (PST) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id f19-20020ac859d3000000b002de4d014733sm974987qtf.13.2022.03.09.01.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 01:43:59 -0800 (PST) From: cgel.zte@gmail.com X-Google-Original-From: yang.yang29@zte.com.cn To: axboe@kernel.dk, viro@zeniv.linux.org.uk, hannes@cmpxchg.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, Yang Yang , Ran Xiaokai Subject: [PATCH] block/psi: remove PSI annotations from submit_bio Date: Wed, 9 Mar 2022 09:43:24 +0000 Message-Id: <20220309094323.2082884-1-yang.yang29@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yang psi tracks the time spent submitting the IO of refaulting pages[1]. But after we tracks refault stalls from swap_readpage[2][3], there is no need to do so anymore. Since swap_readpage already includes IO submitting time. [1] commit b8e24a9300b0 ("block: annotate refault stalls from IO submission") [2] commit 937790699be9 ("mm/page_io.c: annotate refault stalls from swap_readpage") [3] commit 2b413a1a728f ("mm: page_io: fix psi memory pressure error on cold swapins") Signed-off-by: Yang Yang Reviewed-by: Ran Xiaokai --- 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 3c57b3ba727d..efbbeed348e3 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1034,9 +1034,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); @@ -1252,9 +1249,6 @@ static int __bio_iov_append_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) { @@ -1273,8 +1267,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 ddac62aebc55..faf7d950a4d5 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -911,22 +910,6 @@ void submit_bio(struct bio *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 aef06e607b40..5cac8c8869c5 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -419,8 +419,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 0c7a9a1f06c8..ab50c59b02ce 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -314,7 +314,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 */ -- 2.25.1