From patchwork Sat Aug 19 14:12:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 13358639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60E2DEE4993 for ; Sat, 19 Aug 2023 14:13:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45DAD90001A; Sat, 19 Aug 2023 10:12:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E7A6900011; Sat, 19 Aug 2023 10:12:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2144490001A; Sat, 19 Aug 2023 10:12:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 09E71900011 for ; Sat, 19 Aug 2023 10:12:52 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D5F651408A7 for ; Sat, 19 Aug 2023 14:12:51 +0000 (UTC) X-FDA: 81141045342.26.7C7C352 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by imf23.hostedemail.com (Postfix) with ESMTP id 14A79140010 for ; Sat, 19 Aug 2023 14:12:49 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=YPTYau8i; spf=pass (imf23.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.219.47 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692454370; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kSjHpIarSFWJNPdWsAvPv/NwMFUjoCdaJnar30zRHJU=; b=6Y/2ixgQP8BqItCT8UjOqICJ+fccCnyMFWZeHKTCnlrEBL1WFCqhjyNrA1Q0FUGC+dFpn4 x2NMb+s6CdFQGJtQCX2P2NsRK0idCNJVqTK0NpBh3zB1Uefni2ql014oWR5X0o+SoTJoSI bkLcNKJAP+Pj796nibKq3K9XUhE94OA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692454370; a=rsa-sha256; cv=none; b=4iezM28yoQWwa8kOuzEdgNfJwA5yPtZ7/HW0jdcq04ln8W5+G5cl4iU3iCdooKnPLDqkYH Ak331cqKjU5a787nXLEsPcadSbwX8JB6K1M8Xajq3CIyHBCWuRpUzv6scCXj8D0ou2+NWQ lIOjcUQgr8oalFXVqtyQ8ZVsORKAkDw= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=YPTYau8i; spf=pass (imf23.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.219.47 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-64bb576b8abso7988236d6.2 for ; Sat, 19 Aug 2023 07:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692454369; x=1693059169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kSjHpIarSFWJNPdWsAvPv/NwMFUjoCdaJnar30zRHJU=; b=YPTYau8iMQLnPV+8MSH/8fja/dsf3ZcEtp5kyGNDrnFQqPSXA5t6VdW4PpzV8wj9De 9w4eBuHp337uqHsSO8utHM8/RVexJMd4Nq1n4C8TDizf3M2jE01bhejhVqpv67N90w3m /8hJWdkhJO1gY/EjNZkWkBPTBTnXoF4wuIv9yOUkUWDdwRQyE9douqL/HsdzxxILocF1 iOyufwrqJiVlOWBYHXCP40osxOUD/3qinlpd6jk6RJgTZk4jgn6odD4ol+tnkFtuw5k6 LxPvVHNtQxQz8fCwlXbUSbbzBIOIa6DuKbo9gMZIF6Uov1UISZHXIyeaEbDQRmznnsAk dP0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692454369; x=1693059169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kSjHpIarSFWJNPdWsAvPv/NwMFUjoCdaJnar30zRHJU=; b=DthQLe12FWRuHHmzJmp4gKXTooooBHxhXXOZe9S9Y7t8cLV+fTsRiMkL7GX8Sx4dV1 7A5mIF8JdDnDJCz6w3kaRk2AKXWk2syvN+oIFMF2uRmI88tYFtPhMA1TMRdDTRrRr9OB 2mNrHPN4cz1h9Qa70AlBjp/HdYcnKGiMh0ZHXpp1+YgoRg8qGdfLTX1YrE20WS61dSh9 V8KRh54g3V9PVqm85pT+Z7ZDMUPbZqtHNbDGEAwQE+Mws12ChLs5zwHhlrSTPWagNTSK 0RbI9j5mBu/fdhl34j3NTqIWgaVWxfrBWKCdGMVYY5OAhgdpTYxthl0DUrg7e9xe0lIz 3pTA== X-Gm-Message-State: AOJu0Yyu0PBMSIJEq5EQkZBiVfXf2kEOOjq85bae6oiwU5qvP9WV/aEm Kt6cgxkLJKHx5hro94jK400= X-Google-Smtp-Source: AGHT+IFlP2jDt8uZ7TktMhzGEL+WSo8Hr7UkTWitsqazph963ocRgXITG4K/KKqigpjjb7d7gIYaJQ== X-Received: by 2002:a0c:f34d:0:b0:647:1764:7e1a with SMTP id e13-20020a0cf34d000000b0064717647e1amr1891960qvm.27.1692454369104; Sat, 19 Aug 2023 07:12:49 -0700 (PDT) Received: from localhost ([32.218.242.113]) by smtp.gmail.com with ESMTPSA id x8-20020a0ce0c8000000b0062def68f75csm68439qvk.124.2023.08.19.07.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 07:12:48 -0700 (PDT) From: Yury Norov To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Yury Norov , Ingo Molnar , Peter Zijlstra , Andrew Morton , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Jacob Keller , Jakub Kicinski , Juri Lelli , Mel Gorman , Steven Rostedt , Tariq Toukan , Valentin Schneider , Vincent Guittot , shiju.jose@huawei.com, jonathan.cameron@huawei.com, prime.zeng@huawei.com, linuxarm@huawei.com, yangyicong@hisilicon.com, Andy Shevchenko , Rasmus Villemoes Subject: [PATCH v2 6/6] sched: fix sched_numa_find_nth_cpu() comment Date: Sat, 19 Aug 2023 07:12:38 -0700 Message-Id: <20230819141239.287290-7-yury.norov@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230819141239.287290-1-yury.norov@gmail.com> References: <20230819141239.287290-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 14A79140010 X-Rspam-User: X-Stat-Signature: h61t78d3ywpfbnmnzehzgqupsj7mniq7 X-Rspamd-Server: rspam03 X-HE-Tag: 1692454369-661568 X-HE-Meta: U2FsdGVkX18QTvfvBiw33gC+RbtquzuWEQCJyYlXPfAqgs2HMzuqYrB1UFPgqxUrqSo7X6IBxhN0lF5m6BEEo4VGPCs+BjAyRCPpiGcVQFcWezb0Ramuvnz7KLZfhJmzcXN3aMf2fMZ8fdJzWqqC+oyhl2inEJe/Tir2eZCVd1G9cnMOTua4XRrrRf1IAqQoEg+Wqz2MWcmyOGQ2OtpP0TtcRQoRWfjeY42rMrR//3BSVwFnsgUKSolpYeF/KOSxll1Q6V6kH5lX/S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HJun7P2+2RWcvaT7ry5No9UIe8gV+mq9vYU1G94EXvKvOFmnPrSJAult2HGBmkver74XscGtCkz3f6pCY6iuWZcKZ7sr4AgulX2MRDPj4j1R8nBAupzEymR8KmcFrJTy6u+o2eQ4g1JQGcRXVV3YV5hNbrBW8LZJ05bgOjp0NVxOSqe1Oqtw04+iBhqv9dVPVCKEHNLEHOYVyIZFh7YHL1QFbPUgNL5gZEk4saVp5vQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Reword sched_numa_find_nth_cpu() comment and make it kernel-doc compatible. Signed-off-by: Yury Norov --- kernel/sched/topology.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index bc6802700103..789b281d2380 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2103,13 +2103,15 @@ static int hop_cmp(const void *a, const void *b) return -1; } -/* - * sched_numa_find_nth_cpu() - given the NUMA topology, find the Nth next cpu - * closest to @cpu from @cpumask. - * cpumask: cpumask to find a cpu from - * cpu: Nth cpu to find - * - * returns: cpu, or nr_cpu_ids when nothing found. +/** + * sched_numa_find_nth_cpu() - given the NUMA topology, find the Nth closest CPU + * from @cpus to @cpu, taking into account distance + * from a given @node. + * @cpus: cpumask to find a cpu from + * @cpu: CPU to start searching + * @node: NUMA node to order CPUs by distance + * + * Return: cpu, or nr_cpu_ids when nothing found. */ int sched_numa_find_nth_cpu(const struct cpumask *cpus, int cpu, int node) {