From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 187E2CD8CA5 for ; Tue, 10 Oct 2023 15:31:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233361AbjJJPbe (ORCPT ); Tue, 10 Oct 2023 11:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232740AbjJJPbb (ORCPT ); Tue, 10 Oct 2023 11:31:31 -0400 Received: from outbound-smtp05.blacknight.com (outbound-smtp05.blacknight.com [81.17.249.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77834B7 for ; Tue, 10 Oct 2023 08:31:27 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp05.blacknight.com (Postfix) with ESMTPS id 60FFFCCF95 for ; Tue, 10 Oct 2023 16:31:25 +0100 (IST) Received: (qmail 9382 invoked from network); 10 Oct 2023 15:31:25 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.197.19]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 10 Oct 2023 15:31:25 -0000 Date: Tue, 10 Oct 2023 16:31:22 +0100 From: Mel Gorman To: "Matthew Wilcox (Oracle)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Zijlstra , Ingo Molnar , Rik van Riel Subject: Re: [PATCH] bounds: Support non-power-of-two CONFIG_NR_CPUS Message-ID: <20231010153122.iqdv5ezmrjowug53@techsingularity.net> References: <20231010145549.1244748-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20231010145549.1244748-1-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 10, 2023 at 03:55:49PM +0100, Matthew Wilcox (Oracle) wrote: > ilog2() rounds down, so for example when PowerPC 85xx sets CONFIG_NR_CPUS > to 24, we will only allocate 4 bits to store the number of CPUs instead > of 5. Use bits_per() instead, which rounds up. Found by code inspection. > The effect of this would probably be a misaccounting when doing NUMA > balancing, so to a user, it would only be a performance penalty. > The effects may be more wide-spread; it's hard to tell. > > Signed-off-by: Matthew Wilcox (Oracle) > Fixes: 90572890d202 ("mm: numa: Change page last {nid,pid} into {cpu,pid}") > Cc: Peter Zijlstra > Cc: Mel Gorman > Cc: Ingo Molnar > Cc: Rik van Riel Acked-by: Mel Gorman -- Mel Gorman SUSE Labs