From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796273906; b=BDUmgBlhTr+OfuyqOOnTfu2NJ5qLIUScpvgMqewwH5bunEwX5TKxQoBjiRfdLHi/XIlY qC/fd4imKXQo6FurVV/B1qN/7P62O8UmifuoCdsmBbkO/p23CMoXETy3ybA0o+kLW9crR SsIX7EIQNUHVMaQ7GRcj3l5kFSnP7fSROrc5Nl6IW0Zo/DVylT6CR4VjDxY+xaNhIP1da fC/4PJj0L0U4HGT0dP3qXKWn0sZBE0xnjtoVasfCfxsfV4m5cT1nx/k3xGhyIZii9K8MC Dq/JvIKrFeWVCTGBCNSMW/S//fR61Gwfj3eCscDfM3XJd3+EuUovmz7oIpnPHERzZGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796273906; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=OmO768uN7VwXWfAGoRBJXJMDFixeKYiCoTB0ZXulavQ=; b=ZvOXEwNMclcf3WPHBDm7rZmfJEqe1YoZSyL2IwS0mIULy0gDefHCYUedmX6tS4kldA4t SxxY5AAfIk3RjidbZ2DXDuMHRkHA044Slsf76L1bPLX5SAhTyThUmxnWV3fTryqZuywJ6 bUkij5zjSgTsi0RGbjrvTQvRnJuCNwrMG7KO2BZV4UIFkondJOh4EHPqM/wafB08vf9+A W00WHT/j+GlWc3pqbzzJ16T4XQ6WBtMomasacxvKNCZp4F9sJ/RXss3hg05N4t05Hw8C4 0NFhJTuPtlUfUWrjSOSKGyAy9U1BOsCT3Zo2T8aa08JZBi4wauZZZdor3dresw5Gu3Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ivIkfQ1J; arc=none smtp.remote-ip=74.125.82.50 Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE4A0606A322 for ; Thu, 3 Dec 2026 04:58:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE4A0606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ivIkfQ1J Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-1b5adf7eacdso4029379c88.1 for ; Wed, 02 Dec 2026 20:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1796273905; x=1796878705; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=OmO768uN7VwXWfAGoRBJXJMDFixeKYiCoTB0ZXulavQ=; b=ivIkfQ1J5UZ02UvTDsew8jGHnQm1DF7nuvWY0PS8Kpodtweec5kO2JqWiGfSEjPAQr +7fEM3pgHc2jvc7Qw7mfy69JyZnW+3bqF8KeSuO4NrdHVscjIv3YOHbUZwKQCWITmyto f21Un5R5ce4XgGTZSSWBAcOT1ipDov8m/GxHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796273905; x=1796878705; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=OmO768uN7VwXWfAGoRBJXJMDFixeKYiCoTB0ZXulavQ=; b=dQNsqDhFS/UF1q8zCeavhGY9uLNHv58zxC4gwE1GKGPQR8264EzIRLbCaYax9p1tiI xSZ77cs93LIQn2E9aDMX6+pHqWDccbzOe7jZZExziqYDD0Qd8EKxQ+5bgr9T5k0Sz3Gy cxsjvSOMAG1tC9ad4wQ39DWu+qrmL+4Vf5T/zRrYiNsHuqhysitC23gbx7i22sMKOGh/ nuq+ZxEPKycxe1ACIF1NOWB8kq6nhTILM4Bn7Iqb2BolNF0JTllUu7LFTw00fP/Gunbu QFoXliNweRQ70dj5zg8kbQvb7Gf7EvTT3wJLzj+jE1VMl2pvMIDOouiJ07Oc2ssXIYih tTpg== X-Forwarded-Encrypted: i=1; AL+hErH/+ee4wgMMd472CoBAlQSgbtwt9NFRil6SETOvW662/kkFMyVONWbjz1SOcsuXPxi/+Bv9HhdvS+B5dsw=@vger.kernel.org X-Gm-Message-State: APuU4Z9uSrY13hQRolsY4IYGkpBVy/YnqxEc22NvGvRfsHVmzGR2zn6+ ByC4liANUgoin7znqAzy/0aM/Pjk90tHY097FYY7FREAf4VRMYXBD3lOBA520fg3Yg== X-Gm-Gg: AZFdTZfq8a8/P6QdsIi0lhjRcqIptj8XjNCu3Ap66RrzjBA6y8rNvnJ8gv3LLy/Rt03 rKJbsCJbUCg68s3jZIEWhMpacOLYROT7UgSFrNjqKVtydx9eSvJTY58jR9mg/RUfwkV6a7LlHMn ssYjYuu8TnhJbdPUGwUQnedhYw2m7nQ91tVfZfajCBj88q4k4YOsa8zqv2Fi04Mv9gyfIBIWD8F Uwv1VgrrdFb3YQ7ZevYcDyTgbsK8Ftzt+QuB3SCVhVMvaXcNtptCEfmIV7mbL5n2cjc1qu3ExkR IvCiZwYmt5IiMBbpgUVA4pdXb5+gJX3Tf/ppfrVNzn/ufVEF8XtAP4N0VS9A8i2SAspe7A91zeY xkYRq/sNZ/0OkRXu5Mffy24siR1k8AuRD2EuO3l+VlonumL6e+40L5eKLpZ1qhRpYFfrT5o0OjQ R3gwrmugxpmzlW5WZzxLLGzcazwpRiHM2qBZNl+B2eaRnEs+/ebeVYJizd+5MR/EPurXVrCtMff 0VBre7LDm+C8EV9l0qZHtOc8YidrOxBBb+IzoRcj0WopuzFDXsAcsjeTenkU6Y0utRAIF0rTxVX RzAn6OR97mhPsL7PzrK/wGMWNr0FntawikVLWgxSTAkb2Jqdk09Quac+uGsNjkKPpqp50/fgdj9 50S87aHYWygfRsg== X-Received: by 2002:a05:701a:ccce:20b0:1b5:9075:2334 with SMTP id a92af1059eb24-1b590752388mr22340705c88.12.1796273904912; Wed, 02 Dec 2026 20:58:24 -0800 (PST) Received: from google.com ([2a00:79e0:2031:6:e18c:e957:aa04:7114]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5566c1142sm95411224c88.2.2026.12.02.20.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 20:58:24 -0800 (PST) Date: Thu, 3 Dec 2026 13:58:20 +0900 From: Sergey Senozhatsky To: Chris Wiseman Cc: Sergey Senozhatsky , Barry Song , Nanzhe Zhao , Andrew Morton , Minchan Kim , Johannes Weiner , Yosry Ahmed , Nhat Pham , Chengming Zhou , Xueyuan Chen , Xueyuan Chen , Brian Geffon , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/zsmalloc: remove shrinker Message-ID: References: <18ed2967f99a2eff.3137322e32332e3235332e313736.2c2157.0000sendgmr@google.com> <18eda4bfd6c242a5.3137322e32332e3235332e313736.202733.0000sendgmr@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18eda4bfd6c242a5.3137322e32332e3235332e313736.202733.0000sendgmr@google.com> On (26/12/03 04:42), Chris Wiseman wrote: > Hi Sergey, Barry, Nanzhe, Andrew, > > Barry, Nanzhe, thanks for the Pixel 6 numbers. 32 MB to 182 MB median > (622 MB peak) is a real regression, so the shrinker removal shouldn't go > in alone. > > Sergey, moving compaction to a background worker gated on > zs_pool_can_compact() looks good to me. Three quick things on the > sketch: > > 1. Can we make compact_threshold writable after init (like mem_limit) > instead of returning -EBUSY? Android needs to tune it live without > resetting zram. That'll just need WRITE_ONCE() in the store and > READ_ONCE() in zram_schedule_compaction(), since slot_free() doesn't > hold dev_lock. Sure. I didn't want to complicate the patch. It can be run-time tunable. > 2. If it defaults to 0, removing the shrinker regresses anyone who > doesn't know the knob exists. We should pick a non-zero default from > data rather than guessing. Barry, Nanzhe, could you test 5 and 10 on > that same Pixel 6 loop? Right. I guess 5 is a good default. > 3. The 10-second timer doesn't know about memory pressure, whereas the > shrinker ran when reclaim wanted pages. Not a blocker, just the first > thing I'd watch if the Pixel numbers don't come back down. So that 10 seconds cooldown is there because those slot-free calls don't come alone, usually. It's more likely to be a burst of slot-free's and 10 seconds wait kind of tries to space them (burst and compaction) out. > Andrew, please drop mm-zsmalloc-remove-shrinker.patch from mm-new for > now. Once we have the Pixel 6 numbers, we can send a 2-patch series > with Sergey's patch first and the shrinker removal second so git bisect > doesn't hit a regressing commit. Sergey, happy to carry your patch or > rebase mine on top of yours, whichever you prefer. I think your patch will go in as is, no need to rebase, the remaining work will stack on top of it. I guess we want shrinker replacement, just need to figure out what do we replace it with.