Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4822310rwl; Tue, 28 Mar 2023 11:45:56 -0700 (PDT) X-Google-Smtp-Source: AK7set8NZ8eB51ZZv93eaCFPtH0n/9aG+DzL+WJ6C5Z2XZlWmnTBeml1jHcHE3tM/CFauQnaL3vX X-Received: by 2002:a05:6a20:4b04:b0:da:feb5:1829 with SMTP id fp4-20020a056a204b0400b000dafeb51829mr11300508pzb.56.1680029156010; Tue, 28 Mar 2023 11:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680029155; cv=none; d=google.com; s=arc-20160816; b=TdD8k90RAGOdVo0wfJJJDIVCbIgc3xE97s9idSZmZrxj62h2ynT47YiZ9vJY58ZNA8 JGNFd+cAv4cDcCBvUzhRHvLVBnERt2DSbegkTcOn+P3NUmBVGU7X/7xBttc2xFXqGRGz tvJiQL1emI062lbqaUn+HokkrtXcZ0erlTcKNymTlIG9oUrbumBei71FPxQCbFyEnxll ADcj1jhK7VoY893zmGD6mYV1OdCDLXP2YmCnSLf8jF6kkTnsoh7Qc/l+/aYsYpuw/f+4 9AQI7kqZbddlF1KglHJtl7spas0qhfKKJ4lPCTbfzQLdDEvMybognNaHruRByfW4+3O2 buLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Rj2RQnjDsXwaVL7ntpieUXva4Ffe8kxZx/xthWWU0bA=; b=UrJyGKgQi/mTGUJwGwhoPgXqRqrUWb0jXLot9qHHKI9b8G3KE5ADAGnESgtE27PhFq irRfJtpQxCi8xgPkVQeRYT9tCSQJm3m1WTVocdOwb07WwYQjsqLtbLQZ6GyPvX/1SAFO /yIUoqiiRR6fTf9UMgMajYb5tZibPRV08OopLgQz2+8AD/luohfaImiqolzHILRoxggj VizQ/eipBiBkAyMuciUnc8I1ZN2JUurqeTifWCGIgRGWhhP5NbRhmDFNeCVMVz1xxh5Q W5U4p+R8JY0DqHz1/PJ/ZR8KLWY0zz/vY1KRYZZj0yXbtkKBx1SYoqSQkk7Zy0Kk447v oSWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=gsJgxRHD; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r8-20020a654988000000b0050c0674ab43si30216315pgs.378.2023.03.28.11.45.43; Tue, 28 Mar 2023 11:45:55 -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=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=gsJgxRHD; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjC1Snm (ORCPT + 99 others); Tue, 28 Mar 2023 14:43:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjC1Snj (ORCPT ); Tue, 28 Mar 2023 14:43:39 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40D2D1FF3 for ; Tue, 28 Mar 2023 11:43:24 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id i5so53835125eda.0 for ; Tue, 28 Mar 2023 11:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; t=1680029002; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Rj2RQnjDsXwaVL7ntpieUXva4Ffe8kxZx/xthWWU0bA=; b=gsJgxRHD3bOgSTLtfz5lc8JsyfjCFq9/1NiJAHhPimNN7eSlnuIqbiYFd01bZKnjkP vevcfEYFS4Wi1X3PMT55jO0hLoanb2YDgLQB0gSA0WRGTU7cKXBQ7FdqWZXGIUTi0z/D uwwS34T9zxFwD124x/eKhqE+Q3wUyFb+2h4s1O+zEfRZmy/OhHw2EFVJgNUkqIBI9O3W P1W537yWyPHsem/Dbp1zlCM6bVIkxo4eis/m7QM9I4yKYCM8l+XkutscKtdNCdql72dA 78QHdu1hsBdcel8kv8irSlL4e6NqUJGVkREQTZ4WoslS1aU7O0XplLGhNFJ9T9qXSA5z Fklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680029002; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Rj2RQnjDsXwaVL7ntpieUXva4Ffe8kxZx/xthWWU0bA=; b=mi8UtzWvwztF+8TZQWTCZIftU3GDvlsc9N2yswQTn4EjXJTQ480xWLCAFIQpl3WA8i HDfbf6XJp85WFDUzGUJxuvv7OgdIbdvzh8TYYJTGeBvoxH0fyEFgGzlVgzIhKXV6tHJD zOM7MZunSaQ67SXY4odw3SOreMIhQ5VgTUy7HYzZHo1fpohO/Ius457I9m5Yb5XtJzF2 oP4rlgdyXfA/yVVbBVIYArZRG8sNoEHfURHoswl6U2LZcNuNhy+eEskyE/APE8sJehFq y+j2A+kMQeuJ1r3tCXsoqPNPLQ0AvqVyIfagVMn40wGOzD+w/yCXA5nLTBJOBrXrvh1F QVAw== X-Gm-Message-State: AAQBX9ehv/CsvUFG3QkA64ElgDRzghxVtbHE7q4C3su1P1l277LB91WX mQAsFBcAj6xAeU5ukEE9XUKb0A== X-Received: by 2002:a17:906:5849:b0:931:4b0b:73e3 with SMTP id h9-20020a170906584900b009314b0b73e3mr16287762ejs.65.1680029002767; Tue, 28 Mar 2023 11:43:22 -0700 (PDT) Received: from localhost ([2a02:8070:6387:ab20:5139:4abd:1194:8f0e]) by smtp.gmail.com with ESMTPSA id b1-20020a1709065e4100b008ca52f7fbcbsm15499474eju.1.2023.03.28.11.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 11:43:22 -0700 (PDT) Date: Tue, 28 Mar 2023 14:43:21 -0400 From: Johannes Weiner To: Yosry Ahmed Cc: Tejun Heo , Josef Bacik , Jens Axboe , Zefan Li , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Michal =?iso-8859-1?Q?Koutn=FD?= , Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org Subject: Re: [PATCH v1 7/9] workingset: memcg: sleep when flushing stats in workingset_refault() Message-ID: References: <20230328061638.203420-1-yosryahmed@google.com> <20230328061638.203420-8-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230328061638.203420-8-yosryahmed@google.com> X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 28, 2023 at 06:16:36AM +0000, Yosry Ahmed wrote: > @@ -406,6 +406,8 @@ void workingset_refault(struct folio *folio, void *shadow) > unpack_shadow(shadow, &memcgid, &pgdat, &eviction, &workingset); > eviction <<= bucket_order; > > + /* Flush stats (and potentially sleep) before holding RCU read lock */ > + mem_cgroup_flush_stats_ratelimited(); > rcu_read_lock(); Minor nit, but please keep the lock section visually separated by an empty line between the flush and the rcu lock. Other than that, Acked-by: Johannes Weiner