Message ID | 20230323040037.2389095-6-yosryahmed@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2709189wrt; Wed, 22 Mar 2023 21:07:39 -0700 (PDT) X-Google-Smtp-Source: AK7set82Nn1h1vqmKBR+PHWAugEmVXWln2V/eX2aqeMN11tZvtKPSLhH/yLtzsbnr3sK9JCyF8NE X-Received: by 2002:a17:907:98e3:b0:930:2241:3bff with SMTP id ke3-20020a17090798e300b0093022413bffmr10150696ejc.67.1679544458868; Wed, 22 Mar 2023 21:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679544458; cv=none; d=google.com; s=arc-20160816; b=EHlrLOeUW0qaSc1g1lARWoFXWY5w/qh2djIaygYIIeqVB8ezsbMz0jRr+Y60DIdnc9 mnyTYTzajogzNqlCqqMwMuS2CIugQDoS6bu590mNLR1CWfDFGp87UsxTcGxPmu6+plup 3lK5z1xuF8p/VINRKfqAl0gm0ZLnT8uBNtlc3DtiCxXYhJcd9/roA8q7JgwV8KcvM96Y zcYqjgjpn/uH9/FkTDXnr+5/AdwD8W9Ub8STjxJjlIhRB77e98ncj/IjGOdC3R0t1eRH mG6MwAXMLW09e+LGhi8yafvufKAZnRJIK73QuzZLUE1Y32mOdvDt5/b82L1dC3Et/X35 6uXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=9m7S+Ebo8MkLWAncbvKsOW8wVqp1O+0Jr3lM7bEbkLI=; b=WXto82C+8toN5jEndbv+1akbquxHPL6W/3J7RahDew97QR7NLxaZpkdkJ5qJ+lOVke Huc1VQtP8PpMdvrb09eFQASoPe93SjJhFChD6LgExopiLYGEciim+bf0sygNri6zWbz/ gIX7JtzbySuQAl68bnR5sOaJwLZFSmwJjoyIReIY4vIWo4sCOyXmUuVezXMFAp7QA6w7 Dt2QEeiqd4tnuKTtyBoFRdGcOBc1Y9wAQGm69DE4RhcRv8PhSaT8v8dngQHM7vfdOcZi u7/0fHt55JBg0XghrRFbahzDUAoxLTgQTL56wOmiloRtbA/nK2fXo/VWPdp+RFwdVfho 5EUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VdCCijFi; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne38-20020a1709077ba600b008bded90af7csi22243450ejc.531.2023.03.22.21.07.15; Wed, 22 Mar 2023 21:07:38 -0700 (PDT) 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=@google.com header.s=20210112 header.b=VdCCijFi; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbjCWEBK (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 00:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjCWEAx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 00:00:53 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3702E20077 for <linux-kernel@vger.kernel.org>; Wed, 22 Mar 2023 21:00:50 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id b8-20020a17090a488800b0023d1bf65c7eso321934pjh.3 for <linux-kernel@vger.kernel.org>; Wed, 22 Mar 2023 21:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679544050; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9m7S+Ebo8MkLWAncbvKsOW8wVqp1O+0Jr3lM7bEbkLI=; b=VdCCijFiKDJ4yDz8tFMap2tBXNfAakMH2cmowf1HUrZHuzx98c171wgP+Q37bsMmOY dvm3L1704oXKLAgAkOK0GjUnYQoP54+fQujrx3ACvUW9YBMoC0EV4BPolgDqFHWKSqHY vC+M0AbP8Thw306r5f0tU0s0RnClNRrpM7iLZQZCh4urjjm1nPlLVN2cvKbhB0gks3OE JIza4tgsYELq7gTHgeHRM8vhlVtpzgxg6m7gbPXptQ7q4d0Q9K++kyZO3UiZG82ponKY DM+ht1D3A+Eg8Co2dt+ym/gky/eIx2ki3TeVSJ2PxhVMHdlX5/2KaImaACWOeUxKy2jU FXPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679544050; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9m7S+Ebo8MkLWAncbvKsOW8wVqp1O+0Jr3lM7bEbkLI=; b=o0qFcF7Ja9qH1/eOABAH5KeTpTNOCvqQF0KKNRjZB7Vpuz98hQRNYHlPGFnku3x7N9 5W0kRwWAYsx1qEFlidlNjmQvsnW8qRlXrhXO+R8QZZ8ah4QczPRqbR3JgX1VuaQhlLFz eDurzePWPp2BcB7iEr+UHvSazm/UEfc3a0i39Ci0p8SMAH8FJZP0nWQv6m8Bic1CwZ2z WOchGPJV8lN/7Vt84v80zmjnkphA71dV+FnLowMJv1AOV/z/x6vryDQfNwdwoJrs1Z/f QU5cO3TrozWNh623sJyjnWJeUNF3VcoxXlkACtPk8tgp/rXcWBDjVO/yszIyGaO/BXWB 0GXg== X-Gm-Message-State: AO0yUKVYL3iaoXGRc4Ioo9kH4oIXaD8hzXN8qGUmN9C/7M+/S/hbFJ+W AHqyLKCYUIsiI2F4iS/NriH0AcrEhjmIt6Jb X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a05:6a00:80e6:b0:623:8a88:1bba with SMTP id ei38-20020a056a0080e600b006238a881bbamr2937696pfb.2.1679544050539; Wed, 22 Mar 2023 21:00:50 -0700 (PDT) Date: Thu, 23 Mar 2023 04:00:35 +0000 In-Reply-To: <20230323040037.2389095-1-yosryahmed@google.com> Mime-Version: 1.0 References: <20230323040037.2389095-1-yosryahmed@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230323040037.2389095-6-yosryahmed@google.com> Subject: [RFC PATCH 5/7] vmscan: memcg: sleep when flushing stats during reclaim From: Yosry Ahmed <yosryahmed@google.com> To: Tejun Heo <tj@kernel.org>, Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>, Zefan Li <lizefan.x@bytedance.com>, Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Roman Gushchin <roman.gushchin@linux.dev>, Shakeel Butt <shakeelb@google.com>, Muchun Song <muchun.song@linux.dev>, Andrew Morton <akpm@linux-foundation.org> Cc: Vasily Averin <vasily.averin@linux.dev>, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, Yosry Ahmed <yosryahmed@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761130010676783370?= X-GMAIL-MSGID: =?utf-8?q?1761130010676783370?= |
Series |
Make rstat flushing IRQ and sleep friendly
|
|
Commit Message
Yosry Ahmed
March 23, 2023, 4 a.m. UTC
Memory reclaim should be a sleepable context. Allow sleeping when
flushing memcg stats to avoid unnecessarily performing a lot of work
without sleeping. This can slow down reclaim code if flushing stats is
taking too long, but there is already multiple cond_resched()'s in
reclaim code.
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c index 59d1830d08ac..bae35cfb33c8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2845,7 +2845,7 @@ static void prepare_scan_count(pg_data_t *pgdat, struct scan_control *sc) * Flush the memory cgroup stats, so that we read accurate per-memcg * lruvec stats for heuristics. */ - mem_cgroup_flush_stats(false); + mem_cgroup_flush_stats(true); /* * Determine the scan balance between anon and file LRUs.