From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (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 C4DB523395C for ; Tue, 4 Aug 2026 03:44:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785815072; cv=none; b=IGO+y7D/uXU92LryTO0Hj2AYOCC+IqLaXoLiUv/idSXoFovgpuM3X7zSMXdcYzbA1ikWo6kjF1XL/e+qRd4MA1Dkk0BT5E+ubCUVd8c2Xq9AIjSHA6fnXIyXBG4YwlJDL3NoNDTqxFMdV0ece05zYgw6g10jdektA8598Q6GNGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785815072; c=relaxed/simple; bh=dlB9/dE5YOdy6kHXo9XrjP1ya9otzPCkEElrDbuguKA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GXlm0e9pe4U/6RsT4Iuguxm9P2lHhMUro6+CtX+FGlMCpz9X3WeAvDAS3V4xSkxV+mMu7eeEhW/rYieQW4Mwx3Zsb09bVIn9EI48HG+ROJEs8BGvsHqvRz+l/1+7O3hp98gFThxfZOKNJ/o5cZoBkvsnQ16uHKtq3AZtXbnmZz0= 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=E02hleaG; arc=none smtp.client-ip=209.85.216.43 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="E02hleaG" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-383cb94f742so4133022a91.3 for ; Mon, 03 Aug 2026 20:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785815071; x=1786419871; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=gHlxD9SZ+u2gs1CRtUV4D2SEPpBl29EqWm5IJrJZ3p0=; b=E02hleaGp2mvltASuU/qxrXyGBF1qRSXnoa/GddBajPkXHr51czSMepwvv5SlDKc7R Ie91+y5voD3odNVb9GxaBB9kNpzYULNOzqDwkH4U+Oem37chcR2DgygCAz20l9U+aMJz dtUFTg3pQueUitEz8vtHmimPWHWZbYzqHXJ02TMtx62ocl2qDU4VfSVnOuybhyJ3YJYB jEKHLfUrgtjgZ5qLULAa3sDK8MPhGZlexvJRdT2Xl5fz21qTHErDCOqWT6kLcmQ3GGs6 v+OM8A5wXNh+IPzIiZysXZcTsELIEn0BpgQHTnXg9HdRE/tWiJm6wnDvtEvXZwOV7QPs 85YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785815071; x=1786419871; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gHlxD9SZ+u2gs1CRtUV4D2SEPpBl29EqWm5IJrJZ3p0=; b=ieWjFtl+WW6jzyD3rXPEbV9UHRJamStv6R8PqtKeycwV0QXVPWG0aiIgRQFrNFRmRv gycJLNMAWF4HhP6jSuD+f7j5hP4yyMPuUDPBPeqCc3l91CM6ks++UhQyt9NIfceQIBG5 ibeMDB/ViYrUmYBB76vNxSfXzyRKFIODaEgDmziwC+ZtlPp12Xk6+tPLBjmvO9evLSdU DHoCzsBtrS4edNqdUME+i5QnHkeNxC9HC9BXOadGyKW5JdlVH0FK2BBH5iIyrmKzh0je WsliutC+ANIQX58hwZmcB3iADslEhMs9Nn4TJb5khzhCYo5Ak107J5LVx7RJYPckyCLr qFGQ== X-Gm-Message-State: AOJu0Yyhpfk2VNzqqN+Ev5V8shB094Ugyh/mnM2jzyfGPTcnJjT9BU9c eITRzhpz7/ymT3hFc7j5fz84WPKUz+QlzBdN1wF8Fl0cj/aBSzJ7G5e+imvBA4GI X-Gm-Gg: AR+sD10mEs79WmnVkVE94C9JOnA8JSGcZxJ6zS8l8/XB6sfEHVFJtyJSJ054lbelRi5 cdFTjmSlqQNryAwF7Cl0hciODpUbcjaVglKnh0HTHglUI/axJdNwkasDAM4L79+ZdODXb4OP9ui YuEUyJ5TTYMwZlh0d2q+ADV1TXXVRwMf50Wr8GfQ41WkSWCCV27ddvSKaopXQL+F2nG7qr+UgIm h968T21KA6SqMfCjJDC+srfP92GvgbPijTWcXU+ArtNUKdyKme7lUzUh4k3LP3KS5PZuCmQ2YXp rivZRa9mkh3r/+wxTYkh+9aHnuy7IHojdoq8SahbpMtXGSpPchfjQfqzqOLFu4ZNSOVd6HkY84l 2UyPrZWjOqw20ySTh+gI140MrnqjB/VZPNbraIZeWM3eso6VY3UFjWuPa0UGrpCoaaByl3Fh9fv FWv08Z23swvzRzUgU2nGdUbr3rZPdVkfRNhDkKel0/ibNWHYPv2Mk5u1BobSZC9wuIQA36tsEh X-Received: by 2002:a17:90b:4c0e:b0:38d:c74d:29c5 with SMTP id 98e67ed59e1d1-38fbc495711mr11017754a91.19.1785815071036; Mon, 03 Aug 2026 20:44:31 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fec37f5d9sm582522a91.17.2026.08.03.20.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 20:44:30 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: zenghongling@kylinos.cn, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com Cc: linux-kernel@vger.kernel.org, zhongling0719@126.com, zhanxusheng@xiaomi.com, Zhan Xusheng Subject: Re: [PATCH] sched/numa: Fix scan period for remote private faults Date: Tue, 4 Aug 2026 11:44:22 +0800 Message-ID: <20260804034423.3786720-1-zhanxusheng@xiaomi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804030731.539809-1-zenghongling@kylinos.cn> References: <20260804030731.539809-1-zenghongling@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Zhan Xusheng =0D On Tue, Aug 04, 2026 at 11:07:31AM +0800, Hongling Zeng wrote:=0D > This is wrong because for remote private memory, we should continue=0D > to the ratio calculation which can speed up scanning to migrate the=0D > memory to the local node.=0D =0D I don't think the ratio calculation actually speeds scanning up in that=0D case, though. For the pure remote-private accesses you describe=0D (shared =3D=3D 0, private > 0):=0D =0D ps_ratio =3D private * NUMA_PERIOD_SLOTS / (private + shared)=0D =3D private * 10 / (private + 0)=0D =3D 10=0D =0D which is >=3D NUMA_PERIOD_THRESHOLD (7), so it takes the first branch:=0D =0D int slot =3D ps_ratio - NUMA_PERIOD_THRESHOLD; /* 3 */=0D diff =3D slot * period_slot; /* > 0 */=0D =0D and numa_scan_period is *increased* (scan slower), not decreased. The=0D speed-up (else) branch is only reached when both ps_ratio < 7 and=0D lr_ratio < 7, which pure-private accesses (ps_ratio =3D=3D 10) never satisf= y.=0D =0D So dropping the early return here doesn't speed scanning up; it just=0D grows the period by ~3 slots instead of doubling it. That might still be=0D a reasonable change, but the justification as written describes an effect=0D that doesn't seem to happen. Could you double-check, and share some=0D before/after numbers on a remote-private workload? A scan-rate change=0D like this really wants data behind it.=0D =0D Two smaller things:=0D =0D - The comment rewrites (ps_ratio -> "private", lr_ratio -> "local") look= =0D like a reasonable cleanup on their own, but folding them into a=0D behavioural change makes the patch harder to review -- perhaps split=0D them out. (The lr_ratio branch also keeps the "shared ... moved by=0D other tasks" sentence, which no longer fits a local-dominant branch.)=0D =0D - This is the same early return that other in-flight patches touch (the=0D numa_faults_locality reset thread, where Peter suggested sharing the=0D tail with the normal path). It may be worth coordinating so the=0D changes don't collide.=0D =0D Thanks,=0D Zhan Xusheng=0D