linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa
       [not found] <20220210224933.379149-1-yury.norov@gmail.com>
@ 2022-02-10 22:49 ` Yury Norov
  2022-02-14 19:18   ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Yury Norov @ 2022-02-10 22:49 UTC (permalink / raw)
  To: Yury Norov, Andy Shevchenko, Rasmus Villemoes, Andrew Morton,
	Michał Mirosław, Greg Kroah-Hartman, Peter Zijlstra,
	David Laight, Joe Perches, Dennis Zhou, Emil Renner Berthing,
	Nicholas Piggin, Matti Vaittinen, Alexey Klimov, linux-kernel,
	Rafael J. Wysocki, Len Brown, Dan Williams, Huacai Chen,
	Vitaly Kuznetsov, Alison Schofield, linux-acpi

acpi_map_pxm_to_node() calls nodes_weight() to compare the weight
of nodemask with a given number. We can do it more efficiently with
nodes_weight_eq() because conditional nodes_weight may stop
traversing the nodemask earlier, as soon as condition is (or is not)
met.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 drivers/acpi/numa/srat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
index 3b818ab186be..fe7a7996f553 100644
--- a/drivers/acpi/numa/srat.c
+++ b/drivers/acpi/numa/srat.c
@@ -67,7 +67,7 @@ int acpi_map_pxm_to_node(int pxm)
 	node = pxm_to_node_map[pxm];
 
 	if (node == NUMA_NO_NODE) {
-		if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
+		if (nodes_weight_ge(nodes_found_map, MAX_NUMNODES))
 			return NUMA_NO_NODE;
 		node = first_unset_node(nodes_found_map);
 		__acpi_map_pxm_to_node(pxm, node);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa
  2022-02-10 22:49 ` [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa Yury Norov
@ 2022-02-14 19:18   ` Rafael J. Wysocki
  2022-02-14 19:34     ` Yury Norov
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2022-02-14 19:18 UTC (permalink / raw)
  To: Yury Norov
  Cc: Andy Shevchenko, Rasmus Villemoes, Andrew Morton,
	Michał Mirosław, Greg Kroah-Hartman, Peter Zijlstra,
	David Laight, Joe Perches, Dennis Zhou, Emil Renner Berthing,
	Nicholas Piggin, Matti Vaittinen, Alexey Klimov,
	Linux Kernel Mailing List, Rafael J. Wysocki, Len Brown,
	Dan Williams, Huacai Chen, Vitaly Kuznetsov, Alison Schofield,
	ACPI Devel Maling List

On Fri, Feb 11, 2022 at 1:31 AM Yury Norov <yury.norov@gmail.com> wrote:
>
> acpi_map_pxm_to_node() calls nodes_weight() to compare the weight
> of nodemask with a given number. We can do it more efficiently with
> nodes_weight_eq() because conditional nodes_weight may stop
> traversing the nodemask earlier, as soon as condition is (or is not)
> met.
>
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
>  drivers/acpi/numa/srat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> index 3b818ab186be..fe7a7996f553 100644
> --- a/drivers/acpi/numa/srat.c
> +++ b/drivers/acpi/numa/srat.c
> @@ -67,7 +67,7 @@ int acpi_map_pxm_to_node(int pxm)
>         node = pxm_to_node_map[pxm];
>
>         if (node == NUMA_NO_NODE) {
> -               if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
> +               if (nodes_weight_ge(nodes_found_map, MAX_NUMNODES))
>                         return NUMA_NO_NODE;
>                 node = first_unset_node(nodes_found_map);
>                 __acpi_map_pxm_to_node(pxm, node);
> --

Applied as 5.18 material, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa
  2022-02-14 19:18   ` Rafael J. Wysocki
@ 2022-02-14 19:34     ` Yury Norov
  2022-02-14 19:45       ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Yury Norov @ 2022-02-14 19:34 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andy Shevchenko, Rasmus Villemoes, Andrew Morton,
	Michał Mirosław, Greg Kroah-Hartman, Peter Zijlstra,
	David Laight, Joe Perches, Dennis Zhou, Emil Renner Berthing,
	Nicholas Piggin, Matti Vaittinen, Alexey Klimov,
	Linux Kernel Mailing List, Len Brown, Dan Williams, Huacai Chen,
	Vitaly Kuznetsov, Alison Schofield, ACPI Devel Maling List

On Mon, Feb 14, 2022 at 08:18:27PM +0100, Rafael J. Wysocki wrote:
> On Fri, Feb 11, 2022 at 1:31 AM Yury Norov <yury.norov@gmail.com> wrote:
> >
> > acpi_map_pxm_to_node() calls nodes_weight() to compare the weight
> > of nodemask with a given number. We can do it more efficiently with
> > nodes_weight_eq() because conditional nodes_weight may stop
> > traversing the nodemask earlier, as soon as condition is (or is not)
> > met.
> >
> > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > ---
> >  drivers/acpi/numa/srat.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> > index 3b818ab186be..fe7a7996f553 100644
> > --- a/drivers/acpi/numa/srat.c
> > +++ b/drivers/acpi/numa/srat.c
> > @@ -67,7 +67,7 @@ int acpi_map_pxm_to_node(int pxm)
> >         node = pxm_to_node_map[pxm];
> >
> >         if (node == NUMA_NO_NODE) {
> > -               if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
> > +               if (nodes_weight_ge(nodes_found_map, MAX_NUMNODES))
> >                         return NUMA_NO_NODE;
> >                 node = first_unset_node(nodes_found_map);
> >                 __acpi_map_pxm_to_node(pxm, node);
> > --
> 
> Applied as 5.18 material, thanks!

It depends on patches 44 and 26. Are you applying them too?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa
  2022-02-14 19:34     ` Yury Norov
@ 2022-02-14 19:45       ` Rafael J. Wysocki
  2022-02-14 19:55         ` Yury Norov
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2022-02-14 19:45 UTC (permalink / raw)
  To: Yury Norov
  Cc: Rafael J. Wysocki, Andy Shevchenko, Rasmus Villemoes,
	Andrew Morton, Michał Mirosław, Greg Kroah-Hartman,
	Peter Zijlstra, David Laight, Joe Perches, Dennis Zhou,
	Emil Renner Berthing, Nicholas Piggin, Matti Vaittinen,
	Alexey Klimov, Linux Kernel Mailing List, Len Brown,
	Dan Williams, Huacai Chen, Vitaly Kuznetsov, Alison Schofield,
	ACPI Devel Maling List

On Mon, Feb 14, 2022 at 8:36 PM Yury Norov <yury.norov@gmail.com> wrote:
>
> On Mon, Feb 14, 2022 at 08:18:27PM +0100, Rafael J. Wysocki wrote:
> > On Fri, Feb 11, 2022 at 1:31 AM Yury Norov <yury.norov@gmail.com> wrote:
> > >
> > > acpi_map_pxm_to_node() calls nodes_weight() to compare the weight
> > > of nodemask with a given number. We can do it more efficiently with
> > > nodes_weight_eq() because conditional nodes_weight may stop
> > > traversing the nodemask earlier, as soon as condition is (or is not)
> > > met.
> > >
> > > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > > ---
> > >  drivers/acpi/numa/srat.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> > > index 3b818ab186be..fe7a7996f553 100644
> > > --- a/drivers/acpi/numa/srat.c
> > > +++ b/drivers/acpi/numa/srat.c
> > > @@ -67,7 +67,7 @@ int acpi_map_pxm_to_node(int pxm)
> > >         node = pxm_to_node_map[pxm];
> > >
> > >         if (node == NUMA_NO_NODE) {
> > > -               if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
> > > +               if (nodes_weight_ge(nodes_found_map, MAX_NUMNODES))
> > >                         return NUMA_NO_NODE;
> > >                 node = first_unset_node(nodes_found_map);
> > >                 __acpi_map_pxm_to_node(pxm, node);
> > > --
> >
> > Applied as 5.18 material, thanks!
>
> It depends on patches 44 and 26. Are you applying them too?

No, I'm not (I've only received this one directly).

I'll drop this patch now and please feel free to add my ACK to it.

Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa
  2022-02-14 19:45       ` Rafael J. Wysocki
@ 2022-02-14 19:55         ` Yury Norov
  0 siblings, 0 replies; 5+ messages in thread
From: Yury Norov @ 2022-02-14 19:55 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andy Shevchenko, Rasmus Villemoes, Andrew Morton,
	Michał Mirosław, Greg Kroah-Hartman, Peter Zijlstra,
	David Laight, Joe Perches, Dennis Zhou, Emil Renner Berthing,
	Nicholas Piggin, Matti Vaittinen, Alexey Klimov,
	Linux Kernel Mailing List, Len Brown, Dan Williams, Huacai Chen,
	Vitaly Kuznetsov, Alison Schofield, ACPI Devel Maling List

On Mon, Feb 14, 2022 at 11:45 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Mon, Feb 14, 2022 at 8:36 PM Yury Norov <yury.norov@gmail.com> wrote:
> >
> > On Mon, Feb 14, 2022 at 08:18:27PM +0100, Rafael J. Wysocki wrote:
> > > On Fri, Feb 11, 2022 at 1:31 AM Yury Norov <yury.norov@gmail.com> wrote:
> > > >
> > > > acpi_map_pxm_to_node() calls nodes_weight() to compare the weight
> > > > of nodemask with a given number. We can do it more efficiently with
> > > > nodes_weight_eq() because conditional nodes_weight may stop
> > > > traversing the nodemask earlier, as soon as condition is (or is not)
> > > > met.
> > > >
> > > > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > > > ---
> > > >  drivers/acpi/numa/srat.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> > > > index 3b818ab186be..fe7a7996f553 100644
> > > > --- a/drivers/acpi/numa/srat.c
> > > > +++ b/drivers/acpi/numa/srat.c
> > > > @@ -67,7 +67,7 @@ int acpi_map_pxm_to_node(int pxm)
> > > >         node = pxm_to_node_map[pxm];
> > > >
> > > >         if (node == NUMA_NO_NODE) {
> > > > -               if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
> > > > +               if (nodes_weight_ge(nodes_found_map, MAX_NUMNODES))
> > > >                         return NUMA_NO_NODE;
> > > >                 node = first_unset_node(nodes_found_map);
> > > >                 __acpi_map_pxm_to_node(pxm, node);
> > > > --
> > >
> > > Applied as 5.18 material, thanks!
> >
> > It depends on patches 44 and 26. Are you applying them too?
>
> No, I'm not (I've only received this one directly).
>
> I'll drop this patch now and please feel free to add my ACK to it.

OK, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-14 21:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220210224933.379149-1-yury.norov@gmail.com>
2022-02-10 22:49 ` [PATCH 45/49] ACPI: replace nodes__weight with nodes_weight_ge for numa Yury Norov
2022-02-14 19:18   ` Rafael J. Wysocki
2022-02-14 19:34     ` Yury Norov
2022-02-14 19:45       ` Rafael J. Wysocki
2022-02-14 19:55         ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).