<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/klist.h, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-06-19T15:09:08+00:00</updated>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 244</title>
<updated>2019-06-19T15:09:08+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-03T05:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e311edbc45de6163a278fd5a8be0dabe2efd9b9b'/>
<id>urn:sha1:e311edbc45de6163a278fd5a8be0dabe2efd9b9b</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this file is rleased under the gpl v2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 1 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190602204654.725819457@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>klist: implement klist_prev()</title>
<updated>2015-07-28T07:50:42+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2015-07-27T15:03:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e0fed7f7cdc41679e209c5636ad7537dc6210a9'/>
<id>urn:sha1:2e0fed7f7cdc41679e209c5636ad7537dc6210a9</id>
<content type='text'>
klist_prev() gets the previous element in the list. It is useful to traverse
through the list in reverse order, for example, to provide LIFO (last in first
out) variant of access.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>klist: use same naming scheme as hlist for klist_add_after()</title>
<updated>2014-08-07T01:01:24+00:00</updated>
<author>
<name>Ken Helias</name>
<email>kenhelias@firemail.de</email>
</author>
<published>2014-08-06T23:09:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0f9859ca92c9182bcb8f18c55cae1a04627cbb59'/>
<id>urn:sha1:0f9859ca92c9182bcb8f18c55cae1a04627cbb59</id>
<content type='text'>
The name was modified from hlist_add_after() to hlist_add_behind() when
adjusting the order of arguments to match the one with
klist_add_after().  This is necessary to break old code when it would
use it the wrong way.

Make klist follow this naming scheme for consistency.

Signed-off-by: Ken Helias &lt;kenhelias@firemail.de&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.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>klist: Fix object alignment on 64-bit.</title>
<updated>2011-02-14T00:54:24+00:00</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-02-14T00:37:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=795abaf1e4e188c4171e3cd3dbb11a9fcacaf505'/>
<id>urn:sha1:795abaf1e4e188c4171e3cd3dbb11a9fcacaf505</id>
<content type='text'>
Commit c0e69a5bbc6f ("klist.c: bit 0 in pointer can't be used as flag")
intended to make sure that all klist objects were at least pointer size
aligned, but used the constant "4" which only works on 32-bit.

Use "sizeof(void *)" which is correct in all cases.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>klist.c: bit 0 in pointer can't be used as flag</title>
<updated>2009-01-21T04:52:10+00:00</updated>
<author>
<name>Jesper Nilsson</name>
<email>Jesper.Nilsson@axis.com</email>
</author>
<published>2009-01-14T10:19:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c0e69a5bbc6fc74184aa043aadb9a53bc58f953b'/>
<id>urn:sha1:c0e69a5bbc6fc74184aa043aadb9a53bc58f953b</id>
<content type='text'>
The commit a1ed5b0cffe4b16a93a6a3390e8cee0fbef94f86
(klist: don't iterate over deleted entries) introduces use of the
low bit in a pointer to indicate if the knode is dead or not,
assuming that this bit is always free.

This is not true for all architectures, CRIS for example may align data
on byte borders.

The result is a bunch of warnings on bootup, devices not being
added correctly etc, reported by Hinko Kocevar &lt;hinko.kocevar@cetrtapot.si&gt;:

------------[ cut here ]------------
WARNING: at lib/klist.c:62 ()
Modules linked in:

Stack from c1fe1cf0:
       c01cc7f4 c1fe1d11 c000eb4e c000e4de 00000000 00000000 c1f4f78f c1f50c2d
       c01d008c c1fdd1a0 c1fdd1a0 c1fe1d38 c0192954 c1fe0000 00000000 c1fe1dc0
       00000002 7fffffff c1fe1da8 c0192d50 c1fe1dc0 00000002 7fffffff c1ff9fcc
Call Trace: [&lt;c000eb4e&gt;] [&lt;c000e4de&gt;] [&lt;c0192954&gt;] [&lt;c0192d50&gt;] [&lt;c001d49e&gt;] [&lt;c000b688&gt;] [&lt;c0192a3c&gt;]
       [&lt;c000b63e&gt;] [&lt;c000b63e&gt;] [&lt;c001a542&gt;] [&lt;c00b55b0&gt;] [&lt;c00411c0&gt;] [&lt;c00b559c&gt;] [&lt;c01918e6&gt;] [&lt;c0191988&gt;]
       [&lt;c01919d0&gt;] [&lt;c00cd9c8&gt;] [&lt;c00cdd6a&gt;] [&lt;c0034178&gt;] [&lt;c000409a&gt;] [&lt;c0015576&gt;] [&lt;c0029130&gt;] [&lt;c0029078&gt;]
       [&lt;c0029170&gt;] [&lt;c0012336&gt;] [&lt;c00b4076&gt;] [&lt;c00b4770&gt;] [&lt;c006d6e4&gt;] [&lt;c006d974&gt;] [&lt;c006dca0&gt;] [&lt;c0028d6c&gt;]
       [&lt;c0028e12&gt;] [&lt;c0006424&gt;] &lt;4&gt;---[ end trace 4eaa2a86a8e2da22 ]---
------------[ cut here ]------------
Repeat ad nauseam.

Wed, Jan 14, 2009 at 12:11:32AM +0100, Bastien ROUCARIES wrote:
&gt; Perhaps using a pointerhackalign trick on this structure where
&gt; #define pointerhackalign(x) __attribute__ ((aligned (x)))
&gt; and declare
&gt; struct klist_node {
&gt; ...
&gt; }  pointerhackalign(2);
&gt;
&gt; Because  __attribute__ ((aligned (x))) could only increase alignment
&gt; it will safe to do that and serve as documentation purpose :)

That works, but we need to do it not for the struct klist_node,
but for the struct we insert into the void * in klist_node,
which is struct klist.

Reported-by: Hinko Kocevar &lt;hinko.kocevar@cetrtapot.si
Cc: Bastien ROUCARIES &lt;roucaries.bastien@gmail.com&gt;
Signed-off-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver core: Remove completion from struct klist_node</title>
<updated>2009-01-06T18:44:30+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>matthew@wil.cx</email>
</author>
<published>2008-10-16T20:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=210272a28465a7a31bcd580d2f9529f924965aa5'/>
<id>urn:sha1:210272a28465a7a31bcd580d2f9529f924965aa5</id>
<content type='text'>
Removing the completion from klist_node reduces its size from 64 bytes
to 28 on x86-64.  To maintain the semantics of klist_remove(), we add
a single list of klist nodes which are pending deletion and scan them.

Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>klist: don't iterate over deleted entries</title>
<updated>2008-10-09T06:56:04+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2008-08-25T17:50:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a1ed5b0cffe4b16a93a6a3390e8cee0fbef94f86'/>
<id>urn:sha1:a1ed5b0cffe4b16a93a6a3390e8cee0fbef94f86</id>
<content type='text'>
A klist entry is kept on the list till all its current iterations are
finished; however, a new iteration after deletion also iterates over
deleted entries as long as their reference count stays above zero.
This causes problems for cases where there are users which iterate
over the list while synchronized against list manipulations and
natuarally expect already deleted entries to not show up during
iteration.

This patch implements dead flag which gets set on deletion so that
iteration can skip already deleted entries.  The dead flag piggy backs
on the lowest bit of knode-&gt;n_klist and only visible to klist
implementation proper.

While at it, drop klist_iter-&gt;i_head as it's redundant and doesn't
offer anything in semantics or performance wise as klist_iter-&gt;i_klist
is dereferenced on every iteration anyway.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>klist: fix coding style errors in klist.h and klist.c</title>
<updated>2008-04-30T23:52:58+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2008-04-30T23:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3bb7fadaf52de3637b834002dac27f6250b4b49'/>
<id>urn:sha1:c3bb7fadaf52de3637b834002dac27f6250b4b49</id>
<content type='text'>
Finally clean up the odd spacing in these files.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>klist: implement klist_add_{after|before}()</title>
<updated>2008-04-30T23:52:47+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-04-22T09:58:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=93dd40013f4f7f4b18d19d0d77855f025bcc57c3'/>
<id>urn:sha1:93dd40013f4f7f4b18d19d0d77855f025bcc57c3</id>
<content type='text'>
Add klist_add_after() and klist_add_before() which puts a new node
after and before an existing node, respectively.  This is useful for
callers which need to keep klist ordered.  Note that synchronizing
between simultaneous additions for ordering is the caller's
responsibility.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>klist: implement KLIST_INIT() and DEFINE_KLIST()</title>
<updated>2008-04-30T23:52:47+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-04-25T18:16:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1da43e4a9ee942c9c967dbe8839476571df0c3ed'/>
<id>urn:sha1:1da43e4a9ee942c9c967dbe8839476571df0c3ed</id>
<content type='text'>
klist is missing static initializers and definition helper.  Add them.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
