Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2389688rdb; Thu, 21 Sep 2023 18:15:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbMQO42WjutaAFHoSPive8AIGKBbxm5ZyRk40n8NLCCmUVvZMseqwKBLcmyxlyp6GqFOcw X-Received: by 2002:a17:90a:130c:b0:26d:1eff:619f with SMTP id h12-20020a17090a130c00b0026d1eff619fmr6660795pja.2.1695345322146; Thu, 21 Sep 2023 18:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695345322; cv=none; d=google.com; s=arc-20160816; b=mv+gVmoUsKZK6dpvsO6zuyMaBQL9YaqwtnRJ3hFvL1/SG7vlSn44D2HHUsUuZTdxCs IcC8amlmZ9pi3kP9e5uNgS/qL5kBD9AnWmrU8Efp8B6hKjCiwBQi6dqEmwKRAt7TJ9Jk 02gRlgfNyTVrd9vCTa+VZbegCaq7chhm1Oa/zBfVerjYCLukxrRVvu1MtHXgQSX5bMMX He54QXE4Aws5xz5GNuy88wrkbJzvK401B8864yYh3jqkhtUuvf7S47f8XTlAoeMEde94 N+5gHYIxI+eRPeL6q+sNvQATo7W23/iYPEavSp0Cw78d7zNzbm5+iAs/k72HwHWLVVYr PP7w== 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=DL8k+l1MNpgPxJT/l20ur7dHn1vMGG4tupDRepb/caI=; fh=vNUu2vtRNdKWSb94rbPy0bEtS7sbyNOlDUGBqrRQcxE=; b=JTQpe20qlYxQJ+8GQdFDXmReT9ORMPBSZCiC673KjlBWOoKHp5vFb4YVzqqrp9/zi0 GrhWsffqeKnFqlZLbCECvwzYMfgBXi623gs6sdYi5iXw6Se+bvALXWED8EwqFCbtp2vo JTclIyJRQOcVKtxk5OGbhYiT81QHpyq2Dduvv5yP7411j9HaoI63UBegQM0saN7y/HBJ prNHvyEkkZ4DJCTdCp5nmiIzwtX5p27CbO3kfb1X2LthWDF6OD8PxeY0L6wcEZQfMYNN OmYR/dVueWHm/xxLwn2zseqCt1nD5UyU1TxmIxg/XYCaTXOSWaamMj1q5NbnlNbBhxZc 269w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Juwufzhi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h15-20020a17090adb8f00b002750846e628si2617419pjv.120.2023.09.21.18.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 18:15:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Juwufzhi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A38F98099CE1; Thu, 21 Sep 2023 11:16:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjIUSO7 (ORCPT + 99 others); Thu, 21 Sep 2023 14:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjIUSO4 (ORCPT ); Thu, 21 Sep 2023 14:14:56 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32307E50; Thu, 21 Sep 2023 10:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695318603; x=1726854603; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FjWBe0gquMx3lNYmeIOSoDBa7nBK8aydjByq9TyafbE=; b=JuwufzhiuqmcvPH4RfML1r0fw9NOvsz4Sh8rnL7VzBP5pK4kLuY1LvNH cz03XKR1E/vXvVxVIZEx5BEAYonHVWI3m4bf54WUT+mKkQ2nPshG/l/T9 RygW7LyGVOlvAnPu5N5H5+oxWtNz6L51JrgL0WCRxXUc0qnUpC0bECOjb unaGXYK+B+XWdlHydlHhW/3gpqUelMYtjG2u/DHEYkuE/PERinX+kvnbY YXNANGwiR3cbmAkARjHpG9bw1g69DePtqRX3SXdGKoLW7s6nS4eNfcvNi kUAceIHwDXAbgBXspY5bdDFwBK2+fG57CiVHtXzatoJ6UXdLqhjJ0qDuk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="359871047" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="359871047" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 04:06:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="870765809" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="870765809" Received: from lkp-server02.sh.intel.com (HELO 9ef86b2655e5) ([10.239.97.151]) by orsmga004.jf.intel.com with ESMTP; 21 Sep 2023 04:06:23 -0700 Received: from kbuild by 9ef86b2655e5 with local (Exim 4.96) (envelope-from ) id 1qjHVl-0009uA-1C; Thu, 21 Sep 2023 11:06:21 +0000 Date: Thu, 21 Sep 2023 19:05:40 +0800 From: kernel test robot To: Yosry Ahmed , Andrew Morton Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Ivan Babrou , Tejun Heo , Michal =?iso-8859-1?Q?Koutn=FD?= , Waiman Long , kernel-team@cloudflare.com, Wei Xu , Greg Thelen , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Subject: Re: [PATCH 4/5] mm: workingset: move the stats flush into workingset_test_recent() Message-ID: <202309211829.Efuqg8NE-lkp@intel.com> References: <20230921081057.3440885-5-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230921081057.3440885-5-yosryahmed@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 11:16:01 -0700 (PDT) Hi Yosry, kernel test robot noticed the following build errors: [auto build test ERROR on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Yosry-Ahmed/mm-memcg-change-flush_next_time-to-flush_last_time/20230921-161246 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20230921081057.3440885-5-yosryahmed%40google.com patch subject: [PATCH 4/5] mm: workingset: move the stats flush into workingset_test_recent() config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20230921/202309211829.Efuqg8NE-lkp@intel.com/config) compiler: powerpc-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230921/202309211829.Efuqg8NE-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202309211829.Efuqg8NE-lkp@intel.com/ All errors (new ones prefixed by >>): mm/workingset.c: In function 'workingset_test_recent': >> mm/workingset.c:461:32: error: invalid use of undefined type 'struct mem_cgroup' 461 | css_get(&eviction_memcg->css); | ^~ vim +461 mm/workingset.c 405 406 /** 407 * workingset_test_recent - tests if the shadow entry is for a folio that was 408 * recently evicted. Also fills in @workingset with the value unpacked from 409 * shadow. 410 * @shadow: the shadow entry to be tested. 411 * @file: whether the corresponding folio is from the file lru. 412 * @workingset: where the workingset value unpacked from shadow should 413 * be stored. 414 * 415 * Return: true if the shadow is for a recently evicted folio; false otherwise. 416 */ 417 bool workingset_test_recent(void *shadow, bool file, bool *workingset) 418 { 419 struct mem_cgroup *eviction_memcg; 420 struct lruvec *eviction_lruvec; 421 unsigned long refault_distance; 422 unsigned long workingset_size; 423 unsigned long refault; 424 int memcgid; 425 struct pglist_data *pgdat; 426 unsigned long eviction; 427 428 rcu_read_lock(); 429 430 if (lru_gen_enabled()) { 431 bool recent = lru_gen_test_recent(shadow, file, 432 &eviction_lruvec, &eviction, 433 workingset); 434 rcu_read_unlock(); 435 return recent; 436 } 437 438 unpack_shadow(shadow, &memcgid, &pgdat, &eviction, workingset); 439 eviction <<= bucket_order; 440 441 /* 442 * Look up the memcg associated with the stored ID. It might 443 * have been deleted since the folio's eviction. 444 * 445 * Note that in rare events the ID could have been recycled 446 * for a new cgroup that refaults a shared folio. This is 447 * impossible to tell from the available data. However, this 448 * should be a rare and limited disturbance, and activations 449 * are always speculative anyway. Ultimately, it's the aging 450 * algorithm's job to shake out the minimum access frequency 451 * for the active cache. 452 * 453 * XXX: On !CONFIG_MEMCG, this will always return NULL; it 454 * would be better if the root_mem_cgroup existed in all 455 * configurations instead. 456 */ 457 eviction_memcg = mem_cgroup_from_id(memcgid); 458 if (!mem_cgroup_disabled() && !eviction_memcg) 459 return false; 460 > 461 css_get(&eviction_memcg->css); 462 rcu_read_unlock(); 463 464 /* Flush stats (and potentially sleep) outside the RCU read section */ 465 mem_cgroup_flush_stats_ratelimited(); 466 467 eviction_lruvec = mem_cgroup_lruvec(eviction_memcg, pgdat); 468 refault = atomic_long_read(&eviction_lruvec->nonresident_age); 469 470 /* 471 * Calculate the refault distance 472 * 473 * The unsigned subtraction here gives an accurate distance 474 * across nonresident_age overflows in most cases. There is a 475 * special case: usually, shadow entries have a short lifetime 476 * and are either refaulted or reclaimed along with the inode 477 * before they get too old. But it is not impossible for the 478 * nonresident_age to lap a shadow entry in the field, which 479 * can then result in a false small refault distance, leading 480 * to a false activation should this old entry actually 481 * refault again. However, earlier kernels used to deactivate 482 * unconditionally with *every* reclaim invocation for the 483 * longest time, so the occasional inappropriate activation 484 * leading to pressure on the active list is not a problem. 485 */ 486 refault_distance = (refault - eviction) & EVICTION_MASK; 487 488 /* 489 * Compare the distance to the existing workingset size. We 490 * don't activate pages that couldn't stay resident even if 491 * all the memory was available to the workingset. Whether 492 * workingset competition needs to consider anon or not depends 493 * on having free swap space. 494 */ 495 workingset_size = lruvec_page_state(eviction_lruvec, NR_ACTIVE_FILE); 496 if (!file) { 497 workingset_size += lruvec_page_state(eviction_lruvec, 498 NR_INACTIVE_FILE); 499 } 500 if (mem_cgroup_get_nr_swap_pages(eviction_memcg) > 0) { 501 workingset_size += lruvec_page_state(eviction_lruvec, 502 NR_ACTIVE_ANON); 503 if (file) { 504 workingset_size += lruvec_page_state(eviction_lruvec, 505 NR_INACTIVE_ANON); 506 } 507 } 508 509 mem_cgroup_put(eviction_memcg); 510 return refault_distance <= workingset_size; 511 } 512 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki