From: Matthew Wilcox <willy@infradead.org>
To: Tvrtko Ursulin <tursulin@igalia.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-dev@igalia.com, Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
Huang Ying <ying.huang@intel.com>, Mel Gorman <mgorman@suse.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Rik van Riel <riel@surriel.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Dave Hansen <dave.hansen@intel.com>,
Andi Kleen <ak@linux.intel.com>, Michal Hocko <mhocko@suse.com>,
David Rientjes <rientjes@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 1/3] mm/numa_balancing: Teach mpol_to_str about the balancing mode
Date: Fri, 5 Jul 2024 15:43:38 +0100 [thread overview]
Message-ID: <ZogGmvTfOXqUtyz6@casper.infradead.org> (raw)
In-Reply-To: <20240705143218.21258-2-tursulin@igalia.com>
On Fri, Jul 05, 2024 at 03:32:16PM +0100, Tvrtko Ursulin wrote:
> + if (flags & MPOL_F_NUMA_BALANCING) {
> + if (hweight16(flags & MPOL_MODE_FLAGS) > 1)
hweight() > 1 seems somewhat inefficient.
!is_power_of_2() would be better. Or clear off the bits as they're
printed and print the bar if the remaining flags are not 0.
> + p += snprintf(p, buffer + maxlen - p, "|");
> + p += snprintf(p, buffer + maxlen - p, "balancing");
> + }
> }
>
> if (!nodes_empty(nodes))
> --
> 2.44.0
>
>
next prev parent reply other threads:[~2024-07-05 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 14:32 [PATCH 0/3] One fix for /proc/<pid>/numa_maps and two RFCs Tvrtko Ursulin
2024-07-05 14:32 ` [PATCH 1/3] mm/numa_balancing: Teach mpol_to_str about the balancing mode Tvrtko Ursulin
2024-07-05 14:43 ` Matthew Wilcox [this message]
2024-07-08 2:08 ` Huang, Ying
2024-07-05 14:32 ` [PATCH 2/3] mm/mempolicy: Use flags lookup array in mpol_to_str Tvrtko Ursulin
2024-07-05 14:32 ` [PATCH 3/3] mm/numa_balancing: Allow setting numa balancing for tmpfs Tvrtko Ursulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZogGmvTfOXqUtyz6@casper.infradead.org \
--to=willy@infradead.org \
--cc=ak@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=rientjes@google.com \
--cc=stable@vger.kernel.org \
--cc=tursulin@igalia.com \
--cc=tvrtko.ursulin@igalia.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox