From nobody Fri Oct 3 15:37:02 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79DEB3469EC for ; Fri, 29 Aug 2025 15:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756482586; cv=none; b=FHsSyxABA8y8xC4Lg+hd0LfxqoDbTLwvj120iCA+6rYMscY4BfRTsRO9VhOiqH3rGN/zC6lzpS1OMSC2R03sOzGFza7GLQePnGxsRTtnyTJeU0HKq3hYmMMZdrUkJRADHYNgFIrrsqSdXQ9nK2DNvcUgYjwyTtik4tuuuI8vv0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756482586; c=relaxed/simple; bh=VRca4O5xWSvVtV07vu7T/vayv/vKzk4YtiAHpk59aYg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hxPJE1p3jc+K380OFYpnhLaFF2cBPAmEcbcGQemA3JsMbT5NxJUQ8/TAx6srDZVwYPveUEPDdvt15rt8h5vyHGtHiccVuNqRIwZ9M4LTRjv9etQ8Pq4sYvy2sQv8RJazndootcnts/5T1GhW4JhuYzYnK+29Y50ryWT4u7vnONI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eeY+u4yR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eeY+u4yR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2141AC4CEF6; Fri, 29 Aug 2025 15:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756482586; bh=VRca4O5xWSvVtV07vu7T/vayv/vKzk4YtiAHpk59aYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eeY+u4yRCSDgJjtSz5hmOoH3x+19w/I5H1KLqf5o9IzSy4VLTHJHmCL04nCDqjl/A Mi3x3LwMHRRn+lb+eRFvvD0VNC/J8aFrykShAPe2Qyw3DFCrMaXcUjLoMtmE5Zqk5v KEY/GMXoPLxWzLoKGwA1a1EU0rS1reEksM2jpm33gu1U3bjqhY20oFcA7TosiH/GOV rUtyYwdKFmyOcDXFLxXk7mOf6qqGFqPUlbXsYWhEPy978x01HZUHGDVX1ckPDmrT8j M9m3hbV2fQHdHo0C6h2vE7P64y7inEVxIublpIAIQq2kbRtatTh4jaUoflsYZPVrL4 ToZ6s8NuGB8Mg== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Marco Crivellari , Michal Hocko , Peter Zijlstra , Tejun Heo , Thomas Gleixner , Waiman Long Subject: [PATCH 31/33] kthread: Document kthread_affine_preferred() Date: Fri, 29 Aug 2025 17:48:12 +0200 Message-ID: <20250829154814.47015-32-frederic@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250829154814.47015-1-frederic@kernel.org> References: <20250829154814.47015-1-frederic@kernel.org> 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" The documentation of this new API has been overlooked during its introduction. Fill the gap. Signed-off-by: Frederic Weisbecker --- kernel/kthread.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/kthread.c b/kernel/kthread.c index f3397cf7542a..b989aeaa441a 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -857,6 +857,18 @@ int kthreadd(void *unused) return 0; } =20 +/** + * kthread_affine_preferred - Define a kthread's preferred affinity + * @p: thread created by kthread_create(). + * @cpumask: preferred mask of CPUs (might not be online, must be possible= ) for @k + * to run on. + * + * Similar to kthread_bind_mask() except that the affinity is not a requir= ement + * but rather a preference that can be constrained by CPU isolation or CPU= hotplug. + * Must be called before the first wakeup of the kthread. + * + * Returns 0 if the affinity has been applied. + */ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *= mask) { struct kthread *kthread =3D to_kthread(p); --=20 2.51.0