From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 064562BEC23 for ; Thu, 25 Jun 2026 09:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782378059; cv=none; b=c09WTVnwoeBpNZIoBzGT16iIh5jIBpcUfaqUuzrrP/gtID8jagQ8EIECVhYFdg6eTlGtWB9DxTkHlKvg6SeFQa+7VFrHNyoJxD97zYTABgFHdhxccrZdZkuYtjezNoLO5DMtNut7aIjgtSXFgTaU0Nzw04LbsVfFCuOlVW7TCu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782378059; c=relaxed/simple; bh=YRgGSVRzNwNsyEihX3anIGw90wPl8ZKlsMume2H79lg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IVPklUt8+Jqy+NPAtHEYuGanEBUpJKa1mICxKWJ11rw194zJJnN5lJD+18RYX5sSzuNsPegtK6wIwT4Ttx0RWTaAhj8/ddP8p7cNEEyX1hmux70qLmFyZcdyDWk41EGSNVFQYc6IyNHXJIZQRe1KASZet6brE8kYt3CFCzBLD+g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=HuKHv6JJ; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="HuKHv6JJ" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-46e30429b10so70265f8f.1 for ; Thu, 25 Jun 2026 02:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1782378056; x=1782982856; darn=vger.kernel.org; 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=WfoZGVTsV5t4p+3rbcX8T0LDvzopvkAnF0ng3yDh508=; b=HuKHv6JJPXOFPgYHinIQpaNZmGHHA3d2Pf2JE6wEu+StFdLbFd91tWEs0zTqLTuUkg p8j9kekOBUb3yZz3ccSYF1oh2NlhyR2X2qgV3XowtCjW/m+09MoM9iSR/MU+LQVOLo5W LF41Q4vcGzw0KPdOboY7/XLGRYE9Bms1uyYxD/SS00g0h93vYEwOffphMWwZ+kc2rHl2 NsMJU8YJH9RW2e0KwRTF6vvzSPz5VXS8Kf7Afcf85KLEh6lx9IyXo8xwNX/Kg+S9MCDK kr2m0qAhEiFr2HCpoEyB6yLm2YLTdqwV4GFNfFOAkONX6sQM6gqY+uP2reJjjhO9i6RJ EBzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782378056; x=1782982856; h=in-reply-to:content-disposition: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; bh=WfoZGVTsV5t4p+3rbcX8T0LDvzopvkAnF0ng3yDh508=; b=Ce6BxzIundW7BNNM300KPr4MVYgsI44QJedJbV1BT8tcv6L/Kuun5QBDyQBPzvO7mu m7G1cxYYl2l7TWmZtcVMlQMFIdEZlLw/z5Jl1PKxsbTnXULKuoEdLGtq9YM/JyEt+bsB 0sl8MQIC+PrGeIaLqUBwvU6bNXDPMuro+INluuh5/33Sj3fPxoe8Jk+Z6pJBHKisbD0Y 7uAicC9BOhbr+KZyjlGpr/e+PHi1qjxL/8EuQ1pq/t+MPM8huxMHkVbql7LxKy44AmYj yeGRgVEQlsS46hIIDgnuJUiIJ1hSlO/qEf64ZeHe8wHzOtb3cSyg19nK8F4Ne5nB486C g1ag== X-Forwarded-Encrypted: i=1; AFNElJ9CSKiSmkpsX9/rRcem134hL91LNIqcPMwd4bvRFSQmPqKSrjoUmcZvtaYcHzfDo73P5uKXxnrR4OPje3A=@vger.kernel.org X-Gm-Message-State: AOJu0YyRAEiSlgfyEULPjyn/NBcjvCggVBJ/FIa6VjJt18eKomQlq6RV 5gvDQsEk43ek5Ihb6emgiP36T2qbPo+RqukRG3oS5LKGpk/5+SWFeN9IJ9X6pi+EohI= X-Gm-Gg: AfdE7cm2uAyo96uvLel2O6oWbiSd3f0s0Rc6daSDvy8ckihlY1uid/SZ/WblQyT61tW /OVGMnKQh2Irlo5ngmE1oNOuFgZ3797q9Xt/aoCn4c3j9IYmM6mnfoeP+O1hbcwLR60QaMWRyDc AxbshX6I31Qsytg8+GvASMphVVJMOqODxyqlmoqn2hD7BeCiUO2ypQSurUKwisEJWIRbuH2t1iQ i9SjkCkadyxVLsULBWME+PnifznUHaH0M5WweT2gsqvsPA0b6ip9uTiXKNmhd+YuPmwg1OefA1y Vg5guPy3ACVcrU810gYBq+6WdN2yV3OepwqIauTek+idTxUkIFxX4OlnQggHXdU8WB+jHoLetmI 6bnRQU2PWv6Mli6GHw2SKDHHil3+OpYLDUlVbMqqhxFEdpWdOusNnPefPbwRhjaOKSTzH1QsLZ6 hpzD7Us44W2rbY6FOYwg== X-Received: by 2002:a05:600c:1392:b0:492:488c:f630 with SMTP id 5b1f17b1804b1-492668b6847mr21727405e9.34.1782378054669; Thu, 25 Jun 2026 02:00:54 -0700 (PDT) Received: from localhost.localdomain ([62.77.90.70]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49263f9c59fsm108017195e9.0.2026.06.25.02.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2026 02:00:54 -0700 (PDT) Date: Thu, 25 Jun 2026 11:00:52 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Usama Arif Cc: Andrew Morton , david@kernel.org, linux-mm@kvack.org, hannes@cmpxchg.org, tj@kernel.org, shakeel.butt@linux.dev, roman.gushchin@linux.dev, liam@infradead.org, linux-kernel@vger.kernel.org, ljs@kernel.org, mhocko@suse.com, rppt@kernel.org, surenb@google.com, vbabka@kernel.org, kernel-team@meta.com Subject: Re: [PATCH 2/2] mm/vmpressure: split v1 userspace eventfd code into vmpressure-v1.c Message-ID: References: <20260606114158.3126210-1-usama.arif@linux.dev> <20260606114158.3126210-3-usama.arif@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mbkwnm3cz7yyfzkf" Content-Disposition: inline In-Reply-To: <20260606114158.3126210-3-usama.arif@linux.dev> --mbkwnm3cz7yyfzkf Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 2/2] mm/vmpressure: split v1 userspace eventfd code into vmpressure-v1.c MIME-Version: 1.0 On Sat, Jun 06, 2026 at 04:41:34AM -0700, Usama Arif = wrote: > Clean up mm/vmpressure.c by separating the cgroup v1 userspace eventfd > interface from the shared and v2 in-kernel code. >=20 > Currently, almost half of mm/vmpressure.c exists to serve tree=3Dtrue: > struct vmpressure_event, the events list and its mutex, the work_struct > and vmpressure_work_fn that drains tree_scanned/tree_reclaimed, the > parent walk, vmpressure_event(), vmpressure_register_event(), > vmpressure_unregister_event(), and vmpressure_prio() (which always > calls vmpressure() with tree=3Dtrue). >=20 > Move it all into a new mm/vmpressure-v1.c built only when > CONFIG_MEMCG_V1=3Dy (following the existing memcontrol-v1.o pattern). Thanks for this dissection. > @@ -283,14 +152,8 @@ void vmpressure(gfp_t gfp, int order, struct mem_cgr= oup *memcg, bool tree, > return; > =20 > if (tree) { > - spin_lock(&vmpr->sr_lock); > - scanned =3D vmpr->tree_scanned +=3D scanned; > - vmpr->tree_reclaimed +=3D reclaimed; > - spin_unlock(&vmpr->sr_lock); > - > - if (scanned < vmpressure_win) > - return; > - schedule_work(&vmpr->work); > + vmpressure_v1_account_tree(vmpr, scanned, reclaimed); > + return; > } else { > enum vmpressure_levels level; > =20 This return; looks weird, I'd either a) drop it or=20 b) keep it + de-indent the rest of the vmpressure(). --mbkwnm3cz7yyfzkf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJEEABYKADkWIQRCE24Fn/AcRjnLivR+PQLnlNv4CAUCajzuPxsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDIACgkQfj0C55Tb+AjOzwD8CPiAls60D/6NjUECmaox xluxdlgyvBk9WbfRajccL3kBAKTgCpg7umM8qKzTqkSgvxvDl7NuPRftLAYNe9Bn 9vIN =Tc+Y -----END PGP SIGNATURE----- --mbkwnm3cz7yyfzkf--