From nobody Thu Dec 18 23:23:12 2025 Received: from mail-yx1-f51.google.com (mail-yx1-f51.google.com [74.125.224.51]) (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 148D218DB2A for ; Wed, 17 Dec 2025 06:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765951508; cv=none; b=X89cwALc8sQGCmjOseD3v3DJL4wDAmy+Hw1IhbPnIo6t2o3y2sTfGxELlfV0Ig/J66xXan5DT0/JwejXkv7K5XpMaiwnRWHt68zxGdiP+2+t/UXoDdYCrEfOkeMWLmW7AsNUnKJtVPuR1vWvJ5ESpejEPcdkQjjeSsg3AVg08VA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765951508; c=relaxed/simple; bh=HYG5n3fj4kQjyrvb6cuWulPRPktCKkFFXVMSwvno5/4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YZkj/3umXxSGDto9XnKaD4TZKCB7YnNGWmS9DeLRElAnhTvjv6MhU3FfbhDEU3S//wiAeckJtI/U3TteseEXjqwGg5Bn9X/PjKQp23RFNPQzyEfW0SZtMFlISlVlLKaNn3SXT2JkQRS9fKgX+eNZs6BaW5zSyJmHwJSA7C+rW58= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MH7bRRiI; arc=none smtp.client-ip=74.125.224.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MH7bRRiI" Received: by mail-yx1-f51.google.com with SMTP id 956f58d0204a3-6446bae1e17so4778635d50.0 for ; Tue, 16 Dec 2025 22:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765951506; x=1766556306; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Pyag2RFbDMZaEW1ZUfh2mD7Rosxr3z/BITgh98T+I7s=; b=MH7bRRiIOoKxAdLDTKi0/m30sx2ZYlaX529We6dG1gbKou4cI4yvm4NGwLpneEHjMS uL2f17uuGLR+DFx1lHip82uVvR0qRpLQiS//FG8kdQvFweJSMcJgf86JMq/Up7VETRJp XKyZuLf8DbcFtwLxkgAb0PLHYK4gD8o8dn1hcucECuyC9DOZubRiGbQe1EmkVPLa0wnl W6frGXJ9B21K5ygc8qMfqMWSGrjgpg2xDv+I8tz2jrWcmPcWzH/V52buOymov6Rgbvll 05vmlQRcdMAhvmIjFfN7fD48VJM32r5FUk7ep5j5WOG/JwHs0bThDGK2Brjm///sO05N 0wEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765951506; x=1766556306; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Pyag2RFbDMZaEW1ZUfh2mD7Rosxr3z/BITgh98T+I7s=; b=nQfeGeFb5AL5Zf+wiGRJRJRVWmVSUVHOfxDFI2nT33jXYOD7pdqBQnDbTd1wiTmG7C FwmAEid2udyu7AEKCja9ty2MLvh3qQVEL9dN7qRff29HNwgWbfwy4RyvX7gZEPoS1ih8 P65fMx0JWGkkwoy5vIVbjLSAS305NE0umzZE/lv7E1fKFZo86BDv9bHfXPCbONDIZxJW ogu991lCE5N9Ox3QDYtQ6ixFVWXtNGyPgGDolEMZvusyHucxTmfNtU5qFVeOLTfyb/eh vLdm+OfMZpH5bEIFeFpe0oUxpI8AUbbK3iuHqsIq4O5PJT2CYizjtANEk8UYp12mJGpQ eATQ== X-Forwarded-Encrypted: i=1; AJvYcCVq+eOqTw+ViZU1TN2Vv7Wiy6g3YtrUEcNM+EDcnz1ij1XS+j59ROkO8gQgCJ526PVagZMO05txZrCEg6A=@vger.kernel.org X-Gm-Message-State: AOJu0Yykp1aAjzdIva1FuojmRjnDFCLIP6UBYXaNVWyP/ktSVsSp/IEd Oh2tKllg3rs8sGDnKxoiNy8LKlZb+YPKdBv+x8HUfLNkURJQiYxJqdMlPtN/5yNkxGk= X-Gm-Gg: AY/fxX4nPxCNss+pwh6Ldv7NBv+UhDYZwmmaEJ/pcR7UgkIhFcjE/S/wRvPwok16c3u xTpZ1f+herKRTbz1mNWCg5kvkkSNluyE1RgTr8brlW1OPHE9fgnWyty2K1yJc5OOAcvhGmFUY58 Omp2UVsruICkqKdkcfmkUYclLiPZza3429r8XZJq4WWy5HS62qGRIM0T9tfIpuTxqY616YIlhcE FljuxILhjbociTnY6snCMkHrRVXv9VsAevxHJUjY9MKBlLOkV08tD3Fbqe4zQVj+N6vlQ3e3jPk eS7ZtRgxOi2ysbcxNgNsWzAj6vhWzfZDM2smcle7NfzWL14+T6Ibd1pi7nj+q4Fv3Za8GA+Yuch 6/E8cToCFyMr+ZCB42fWeC8l+K4XZpGQEryTIRBt1NTTeJDsP4auhXqwEh6PhkbssQpWdHI9KkI Rgw7oYN0TFIXQQKkgQxe5aqQ== X-Google-Smtp-Source: AGHT+IELDZriJQKqPex0nsZHy75JNITcXwoBTqk7IfmCVrXhJRy9Z0N5R1WndPoDPwVcQlcm/Ub7lQ== X-Received: by 2002:a05:690e:1307:b0:640:d009:e998 with SMTP id 956f58d0204a3-645555cdd3cmr12576419d50.12.1765951505907; Tue, 16 Dec 2025 22:05:05 -0800 (PST) Received: from localhost ([2a03:2880:25ff:4d::]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-64477db6476sm8629460d50.20.2025.12.16.22.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Dec 2025 22:05:05 -0800 (PST) From: Joshua Hahn To: Andrew Morton Cc: Daniel Palmer , Guenter Roeck , Brendan Jackman , Johannes Weiner , Michal Hocko , Suren Baghdasaryan , Vlastimil Babka , Zi Yan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] mm/page_alloc: restore 0-handling to zone_set_pageset_high_and_batch Date: Tue, 16 Dec 2025 22:05:03 -0800 Message-ID: <20251217060505.681923-1-joshua.hahnjy@gmail.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 2783088ef24e ("mm/page_alloc: prevent reporting pcp->batch =3D 0") moved the error handling (0-handling) of zone_batchsize from its callers to inside the function. However, the commit left out the error handling for the NOMMU case, leading to deadlocks on NOMMU systems. Since in the NOMMU case the reported-to-user batchsize should still be 0, we would only like the error handling to exist in the callsites that set the internal value for the zone (i.e. zone_set_pageset_high_and_batch). Restore max(1, zone_batchsize(zone)) to the callsite to prevent errors on NOMMU systems. Fixes: 2783088ef24e ("mm/page_alloc: prevent reporting pcp->batch =3D 0") Reported-by: Daniel Palmer Closes: https://lore.kernel.org/linux-mm/CAFr9PX=3D_HaM3_xPtTiBn5Gw5-0xcRpa= wpJ02NStfdr0khF2k7g@mail.gmail.com/ Reported-by: Guenter Roeck Closes: https://lore.kernel.org/all/42143500-c380-41fe-815c-696c17241506@ro= eck-us.net/ Signed-off-by: Joshua Hahn Tested-by: Guenter Roeck --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 822e05f1a964..10c1297fd3ea 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6045,7 +6045,7 @@ static void zone_set_pageset_high_and_batch(struct zo= ne *zone, int cpu_online) { int new_high_min, new_high_max, new_batch; =20 - new_batch =3D zone_batchsize(zone); + new_batch =3D max(1, zone_batchsize(zone)); if (percpu_pagelist_high_fraction) { new_high_min =3D zone_highsize(zone, new_batch, cpu_online, percpu_pagelist_high_fraction); base-commit: 40fbbd64bba6c6e7a72885d2f59b6a3be9991eeb --=20 2.47.3