Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5757657rdb; Wed, 13 Dec 2023 20:29:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHf8MZznksfSE5n/K2L94iHJgSg6+9t5ML5AYqf4IS0w2u00kM0Bytme21LPHlJ8A3Oom3j X-Received: by 2002:a05:6e02:1b07:b0:35d:5995:798a with SMTP id i7-20020a056e021b0700b0035d5995798amr13509021ilv.36.1702528188691; Wed, 13 Dec 2023 20:29:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702528188; cv=none; d=google.com; s=arc-20160816; b=dhmI2c4gUUfiA3w+L9E1UUgMBwVA2hVipFWi5Cfc27Aj5yhn2je7Mbpr/qcc/rOl76 dg8sXov1apKLRE4CTLpBzWh8QsmejUXrcjEvTFnLdm+lK/3sHAXch5gJpRhVYmAqvAZS QixcxgwH+H+j+0RRE2Sp689auITCH7ccPOxnIvsaFsT+2fNnrbIqUuQmT4bWPYgI/bfb jg+kL6OO0XEsA+NljM7AcGJBxSjFQOkTftPUUjy18ovHV9D+CCwYx1rWbPDiZTHkn8Ru WxJgc8jmIpuSJnazP6NWedyXmT5XW2sIF4N4+/6lzoLKje191fMC6mto2mtTh6DE2xeb rnwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LrJKnh7rQalxBTETxx0mDtTP7C8D7JFwx9paPElxJ0A=; fh=CIoX5su+u5dpZ7Fz1jG3nRcy0cIHXSsCwx9E6s/Rz2c=; b=Shu3zNZeyyeygCOc9ro33QrUAFaNtovngk9LG0I9JTAKecV4lv2pWbtmx8LWiKiGQ1 Vkpd98Viq1LRgNoV/OdwSEAN0yW3piRAYH65oyg5QO1KgoMBA2pX0N++VoB7YXsZTlwe xK1ZNbj36OdXq3/h+chFFISybL7bGlVx3Qg/BoRfTuhLuhGmkIohFH3YH27JgWPCiLDF gzPkf+BzHVSH41AQgnXKidyiz2Tn9IRxVSaaYntX84kWYwP8n+9G/fjoAccZYr1bc1hY zIcPSZV3/y37WWEPH58RDpJkQjCEr8lwZ42yr/zNjkweOz87fXFNkniPLJgBJYK+5GUa 01sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iZ7iI1c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id je11-20020a170903264b00b001d09c96b9f9si10561881plb.425.2023.12.13.20.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 20:29:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iZ7iI1c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 76CC382CBA6A; Wed, 13 Dec 2023 20:29:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235224AbjLNE3a (ORCPT + 99 others); Wed, 13 Dec 2023 23:29:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235253AbjLNE31 (ORCPT ); Wed, 13 Dec 2023 23:29:27 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D328109 for ; Wed, 13 Dec 2023 20:29:33 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a1f8a1e9637so41192366b.1 for ; Wed, 13 Dec 2023 20:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702528171; x=1703132971; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LrJKnh7rQalxBTETxx0mDtTP7C8D7JFwx9paPElxJ0A=; b=iZ7iI1c0bscnoDKVDtwt6c43pv5OEWCCzNMHqdJwwZWhs4XPkRWqmhmCMtuogzGclX V4GZTR/6x0nTqrcQnogIj+ab8/Tx+y9oGkMZuU5ZDcm+GRuZDQvuIpi+LtSHH5FdfZfk gcnl5c+1x4ZSyiW6pwzJ9dLAUdhmChWU1h2M2CcDcYEfE9YJ09Kf8oSfo7Nt1PtogDJh h6q+X9l5aG3vgS91hXRqZdQiXxtVir6jSmhXTfiAk0ayrCNck0G5cekK3SkClUU9kVjV pB8sT/3Ij6JuHrufjr1UaAiWy5XHUEEwEPzRcKPBzQMwFmunPuUR9ewUYLdbV2ASvLL5 6R/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702528171; x=1703132971; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LrJKnh7rQalxBTETxx0mDtTP7C8D7JFwx9paPElxJ0A=; b=rEsMsW1OgOvo1Z4SCnS9lnJL/zHgoyxxGCehx1tbrflN4eZGVAJXgTsI5dzQGdY2Dd P0nDl0m4Ly2aUsOP3FREaP02J3RrC3KaEvNOds6Udq96ODVZtT2nZdq/gF6Qg6vZsSzT d0gYTLyAu28M6cwaH3OlGdqKm3lcYmVp6ocLBiCsL20KgIi8fDMT8DyXisL3eeyWtLoi dp3ZKl06PTOjllfSwS4oW2O8HWJp5uk5grDc4oqC/LqebAswXA9r1fTIlHB04anSmnX7 2GlCJVUBsPYKAxwnaLVboYsHreKQ2QBkIHSrFtAmgFlkxdRMsR6SiKQuYgtE9fx3QkkE MtXw== X-Gm-Message-State: AOJu0YzgOI+krAORyGqXhJY9eI8n/5fumT0t7CgHI7WYN93ATDaUO1N5 Bjf+bN0j0EOy/mCUulzhHPaDkXweFBX85kPeltqDLQ== X-Received: by 2002:a17:907:b5a2:b0:a1f:6ead:c119 with SMTP id qx34-20020a170907b5a200b00a1f6eadc119mr9472498ejc.21.1702528171233; Wed, 13 Dec 2023 20:29:31 -0800 (PST) MIME-Version: 1.0 References: <20231213013807.897742-1-schatzberg.dan@gmail.com> <20231213013807.897742-3-schatzberg.dan@gmail.com> In-Reply-To: From: Yosry Ahmed Date: Wed, 13 Dec 2023 20:28:53 -0800 Message-ID: Subject: Re: [PATCH V4 2/2] mm: add swapiness= arg to memory.reclaim To: Dan Schatzberg Cc: Yu Zhao , Johannes Weiner , Roman Gushchin , Huan Yang , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Tejun Heo , Zefan Li , Jonathan Corbet , Michal Hocko , Shakeel Butt , Muchun Song , Andrew Morton , David Hildenbrand , Matthew Wilcox , Kefeng Wang , Yue Zhao , Hugh Dickins Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, 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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 20:29:44 -0800 (PST) On Wed, Dec 13, 2023 at 8:38=E2=80=AFAM Dan Schatzberg wrote: > > On Tue, Dec 12, 2023 at 07:05:36PM -0700, Yu Zhao wrote: > > On Tue, Dec 12, 2023 at 6:39=E2=80=AFPM Dan Schatzberg wrote: > > > > > > Allow proactive reclaimers to submit an additional swappiness=3D > > > argument to memory.reclaim. This overrides the global or per-memcg > > > swappiness setting for that reclaim attempt. > > > > > > For example: > > > > > > echo "2M swappiness=3D0" > /sys/fs/cgroup/memory.reclaim > > > > > > will perform reclaim on the rootcg with a swappiness setting of 0 (no > > > swap) regardless of the vm.swappiness sysctl setting. > > > > > > Signed-off-by: Dan Schatzberg > > > > NAK. > > > > Please initialize new variables properly and test code changes > > thoroughly before submission. > > Could you be a bit more specific? The patch is compiling and working > locally but perhaps there's some configuration or behavior that I > haven't been testing. scan_control.swappiness is only initialized from try_to_free_mem_cgroup_pages(), which means that swappiness is now 0 for all other types of reclaim, which can be a huge problem. It might be easier to restore a special value (-1, 201, whatever) that means "use mem_cgroup_swappiness()".