<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-op-linux/lib/cpumask.c, branch v4.2.2</title>
<subtitle>Talos™ II Linux sources for OpenPOWER</subtitle>
<id>https://git.raptorcs.com/git/talos-op-linux/atom?h=v4.2.2</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-op-linux/atom?h=v4.2.2'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/'/>
<updated>2015-06-19T03:00:23+00:00</updated>
<entry>
<title>revert "cpumask: don't perform while loop in cpumask_next_and()"</title>
<updated>2015-06-19T03:00:23+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2015-06-18T18:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=5ca62d65030d8295f54c490d2072563545dbd9d9'/>
<id>urn:sha1:5ca62d65030d8295f54c490d2072563545dbd9d9</id>
<content type='text'>
Revert commit 534b483a86e6 ("cpumask: don't perform while loop in
cpumask_next_and()").

This was a minor optimization, but it puts a `struct cpumask' on the
stack, which consumes too much stack space.

Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Amir Vadai &lt;amirv@mellanox.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cpumask_set_cpu_local_first =&gt; cpumask_local_spread, lament</title>
<updated>2015-05-28T01:35:20+00:00</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2015-05-08T17:44:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=f36963c9d3f6f415732710da3acdd8608a9fa0e5'/>
<id>urn:sha1:f36963c9d3f6f415732710da3acdd8608a9fa0e5</id>
<content type='text'>
da91309e0a7e (cpumask: Utility function to set n'th cpu...) created a
genuinely weird function.  I never saw it before, it went through DaveM.
(He only does this to make us other maintainers feel better about our own
mistakes.)

cpumask_set_cpu_local_first's purpose is say "I need to spread things
across N online cpus, choose the ones on this numa node first"; you call
it in a loop.

It can fail.  One of the two callers ignores this, the other aborts and
fails the device open.

It can fail in two ways: allocating the off-stack cpumask, or through a
convoluted codepath which AFAICT can only occur if cpu_online_mask
changes.  Which shouldn't happen, because if cpu_online_mask can change
while you call this, it could return a now-offline cpu anyway.

It contains a nonsensical test "!cpumask_of_node(numa_node)".  This was
drawn to my attention by Geert, who said this causes a warning on Sparc.
It sets a single bit in a cpumask instead of returning a cpu number,
because that's what the callers want.

It could be made more efficient by passing the previous cpu rather than
an index, but that would be more invasive to the callers.

Fixes: da91309e0a7e8966d916a74cce42ed170fde06bf
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (then rebased)
Tested-by: Amir Vadai &lt;amirv@mellanox.com&gt;
Acked-by: Amir Vadai &lt;amirv@mellanox.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge tag 'cpumask-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2015-04-20T17:19:03+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-04-20T17:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=6496edfce95f943e1da43631c2f437509e56af7f'/>
<id>urn:sha1:6496edfce95f943e1da43631c2f437509e56af7f</id>
<content type='text'>
Pull final removal of deprecated cpus_* cpumask functions from Rusty Russell:
 "This is the final removal (after several years!) of the obsolete
  cpus_* functions, prompted by their mis-use in staging.

  With these function removed, all cpu functions should only iterate to
  nr_cpu_ids, so we finally only allocate that many bits when cpumasks
  are allocated offstack"

* tag 'cpumask-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (25 commits)
  cpumask: remove __first_cpu / __next_cpu
  cpumask: resurrect CPU_MASK_CPU0
  linux/cpumask.h: add typechecking to cpumask_test_cpu
  cpumask: only allocate nr_cpumask_bits.
  Fix weird uses of num_online_cpus().
  cpumask: remove deprecated functions.
  mips: fix obsolete cpumask_of_cpu usage.
  x86: fix more deprecated cpu function usage.
  ia64: remove deprecated cpus_ usage.
  powerpc: fix deprecated CPU_MASK_CPU0 usage.
  CPU_MASK_ALL/CPU_MASK_NONE: remove from deprecated region.
  staging/lustre/o2iblnd: Don't use cpus_weight
  staging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_
  staging/lustre/ptlrpc: Do not use deprecated cpus_* functions
  blackfin: fix up obsolete cpu function usage.
  parisc: fix up obsolete cpu function usage.
  tile: fix up obsolete cpu function usage.
  arm64: fix up obsolete cpu function usage.
  mips: fix up obsolete cpu function usage.
  x86: fix up obsolete cpu function usage.
  ...
</content>
</entry>
<entry>
<title>cpumask: remove __first_cpu / __next_cpu</title>
<updated>2015-04-19T05:05:32+00:00</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2015-04-18T01:48:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=e4afa120c98252e44390067c3a6cc775cde30659'/>
<id>urn:sha1:e4afa120c98252e44390067c3a6cc775cde30659</id>
<content type='text'>
They were for use by the deprecated first_cpu() and next_cpu() wrappers,
but sparc used them directly.

They're now replaced by cpumask_first / cpumask_next.  And __next_cpu_nr
is completely obsolete.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>cpumask: don't perform while loop in cpumask_next_and()</title>
<updated>2015-04-17T13:04:08+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>sergey.senozhatsky@gmail.com</email>
</author>
<published>2015-04-16T19:48:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=534b483a86e6b96f1b5cc03bbe4b696f3daead6d'/>
<id>urn:sha1:534b483a86e6b96f1b5cc03bbe4b696f3daead6d</id>
<content type='text'>
cpumask_next_and() is looking for cpumask_next() in src1 in a loop and
tests if found cpu is also present in src2. remove that loop, perform
cpumask_and() of src1 and src2 first and use that new mask to find
cpumask_next().

Apart from removing while loop, ./bloat-o-meter on x86_64 shows
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
function                                     old     new   delta
cpumask_next_and                              62      54      -8

Signed-off-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Amir Vadai &lt;amirv@mellanox.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cpumask: only allocate nr_cpumask_bits.</title>
<updated>2015-03-10T03:24:42+00:00</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2015-03-05T00:19:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=cdfdef75e795fb5ab76c66f3329e509f3ab8b9b5'/>
<id>urn:sha1:cdfdef75e795fb5ab76c66f3329e509f3ab8b9b5</id>
<content type='text'>
Now we'll find out the hard way if anyone has CPUMASK_OFFSTACK and is
returning these or assigning them.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>lib/cpumask: cpumask_set_cpu_local_first to use all cores when numa node is not defined</title>
<updated>2014-07-03T01:29:23+00:00</updated>
<author>
<name>Amir Vadai</name>
<email>amirv@mellanox.com</email>
</author>
<published>2014-06-29T08:54:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=143b5ba21b2bd5091cd8dcd92de7ba1ed1d1c83c'/>
<id>urn:sha1:143b5ba21b2bd5091cd8dcd92de7ba1ed1d1c83c</id>
<content type='text'>
When device is non numa aware (numa_node == -1), use all online cpu's.

Signed-off-by: Amir Vadai &lt;amirv@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>cpumask: Utility function to set n'th cpu - local cpu first</title>
<updated>2014-06-11T21:58:16+00:00</updated>
<author>
<name>Amir Vadai</name>
<email>amirv@mellanox.com</email>
</author>
<published>2014-06-09T07:24:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=da91309e0a7e8966d916a74cce42ed170fde06bf'/>
<id>urn:sha1:da91309e0a7e8966d916a74cce42ed170fde06bf</id>
<content type='text'>
This function sets the n'th cpu - local cpu's first.
For example: in a 16 cores server with even cpu's local, will get the
following values:
cpumask_set_cpu_local_first(0, numa, cpumask) =&gt; cpu 0 is set
cpumask_set_cpu_local_first(1, numa, cpumask) =&gt; cpu 2 is set
...
cpumask_set_cpu_local_first(7, numa, cpumask) =&gt; cpu 14 is set
cpumask_set_cpu_local_first(8, numa, cpumask) =&gt; cpu 1 is set
cpumask_set_cpu_local_first(9, numa, cpumask) =&gt; cpu 3 is set
...
cpumask_set_cpu_local_first(15, numa, cpumask) =&gt; cpu 15 is set

Curently this function will be used by multi queue networking devices to
calculate the irq affinity mask, such that as many local cpu's as
possible will be utilized to handle the mq device irq's.

Signed-off-by: Amir Vadai &lt;amirv@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Revert mlx4 cpumask changes.</title>
<updated>2014-06-02T04:58:02+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2014-06-02T04:58:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=ee39facbf82e73e468c504d2b40e83e2d223c28c'/>
<id>urn:sha1:ee39facbf82e73e468c504d2b40e83e2d223c28c</id>
<content type='text'>
This reverts commit 70a640d0dae3a9b1b222ce673eb5d92c263ddd61
("net/mlx4_en: Use affinity hint") and commit
c8865b64b05b2f4eeefd369373e9c8aeb069e7a1 ("cpumask: Utility function
to set n'th cpu - local cpu first") because these changes break
the build when SMP is disabled amongst other things.

Reported-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>cpumask: Utility function to set n'th cpu - local cpu first</title>
<updated>2014-06-02T02:16:29+00:00</updated>
<author>
<name>Amir Vadai</name>
<email>amirv@mellanox.com</email>
</author>
<published>2014-05-25T14:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=c8865b64b05b2f4eeefd369373e9c8aeb069e7a1'/>
<id>urn:sha1:c8865b64b05b2f4eeefd369373e9c8aeb069e7a1</id>
<content type='text'>
This function sets the n'th cpu - local cpu's first.
For example: in a 16 cores server with even cpu's local, will get the
following values:
cpumask_set_cpu_local_first(0, numa, cpumask) =&gt; cpu 0 is set
cpumask_set_cpu_local_first(1, numa, cpumask) =&gt; cpu 2 is set
...
cpumask_set_cpu_local_first(7, numa, cpumask) =&gt; cpu 14 is set
cpumask_set_cpu_local_first(8, numa, cpumask) =&gt; cpu 1 is set
cpumask_set_cpu_local_first(9, numa, cpumask) =&gt; cpu 3 is set
...
cpumask_set_cpu_local_first(15, numa, cpumask) =&gt; cpu 15 is set

Curently this function will be used by multi queue networking devices to
calculate the irq affinity mask, such that as many local cpu's as
possible will be utilized to handle the mq device irq's.

Signed-off-by: Amir Vadai &lt;amirv@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
