Hi Paul, Commit 6a48c1c899e8 ("membarrier: Expedited private command") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell
On Sun, Jul 30, 2017 at 11:48:57PM +1000, Stephen Rothwell wrote:
> Hi Paul,
>
> Commit
>
> 6a48c1c899e8 ("membarrier: Expedited private command")
>
> is missing a Signed-off-by from its committer.
Good catch, fixed.
Thanx, Paul
Hi Paul, Commit d7e182c9c324 ("rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()") is missing a Signed-off-by from its author. -- Cheers, Stephen Rothwell
On Wed, Nov 29, 2017 at 11:51:51AM +1100, Stephen Rothwell wrote: > Hi Paul, > > Commit > > d7e182c9c324 ("rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()") > > is missing a Signed-off-by from its author. Good catch, Stephen! Lihao, would you please get me you Signed-off-by? The patch is below. Thanx, Paul ------------------------------------------------------------------------ commit d7e182c9c32480c1f579dd888ac50e88bfb39596 Author: Liang Lihao <lianglihao@huawei.com> Date: Wed Nov 22 19:00:55 2017 +0000 rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data() Since rcu_boot_init_percpu_data() is only called at boot time, there is no data race and spinlock is not needed. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 69722817d6d6..0abe1db53d70 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3636,12 +3636,9 @@ static void rcu_init_new_rnp(struct rcu_node *rnp_leaf) static void __init rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) { - unsigned long flags; struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu); - struct rcu_node *rnp = rcu_get_root(rsp); /* Set up local state, ensuring consistent view of global state. */ - raw_spin_lock_irqsave_rcu_node(rnp, flags); rdp->grpmask = leaf_node_cpu_bit(rdp->mynode, cpu); rdp->dynticks = &per_cpu(rcu_dynticks, cpu); WARN_ON_ONCE(rdp->dynticks->dynticks_nesting != 1); @@ -3649,7 +3646,6 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) rdp->cpu = cpu; rdp->rsp = rsp; rcu_boot_init_nocb_percpu_data(rdp); - raw_spin_unlock_irqrestore_rcu_node(rnp, flags); } /*
Hi Paul,
Signed-off-by: Lihao Liang <lihao.liang@gmail.com>
Many thanks,
Lihao.
On 2017/11/29 9:14, Paul E. McKenney wrote:
> On Wed, Nov 29, 2017 at 11:51:51AM +1100, Stephen Rothwell wrote:
>> Hi Paul,
>>
>> Commit
>>
>> d7e182c9c324 ("rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()")
>>
>> is missing a Signed-off-by from its author.
>
> Good catch, Stephen!
>
> Lihao, would you please get me you Signed-off-by? The patch is below.
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit d7e182c9c32480c1f579dd888ac50e88bfb39596
> Author: Liang Lihao <lianglihao@huawei.com>
> Date: Wed Nov 22 19:00:55 2017 +0000
>
> rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()
>
> Since rcu_boot_init_percpu_data() is only called at boot time,
> there is no data race and spinlock is not needed.
>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 69722817d6d6..0abe1db53d70 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -3636,12 +3636,9 @@ static void rcu_init_new_rnp(struct rcu_node *rnp_leaf)
> static void __init
> rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp)
> {
> - unsigned long flags;
> struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu);
> - struct rcu_node *rnp = rcu_get_root(rsp);
>
> /* Set up local state, ensuring consistent view of global state. */
> - raw_spin_lock_irqsave_rcu_node(rnp, flags);
> rdp->grpmask = leaf_node_cpu_bit(rdp->mynode, cpu);
> rdp->dynticks = &per_cpu(rcu_dynticks, cpu);
> WARN_ON_ONCE(rdp->dynticks->dynticks_nesting != 1);
> @@ -3649,7 +3646,6 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp)
> rdp->cpu = cpu;
> rdp->rsp = rsp;
> rcu_boot_init_nocb_percpu_data(rdp);
> - raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
> }
>
> /*
>
>
>
Hi Lihao, On 2017/11/29 10:48, Lihao Liang wrote: > Hi Paul, > > Signed-off-by: Lihao Liang <lihao.liang@gmail.com> ... > > Many thanks, > Lihao. > > On 2017/11/29 9:14, Paul E. McKenney wrote: >> On Wed, Nov 29, 2017 at 11:51:51AM +1100, Stephen Rothwell wrote: >>> Hi Paul, >>> >>> Commit >>> >>> d7e182c9c324 ("rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()") >>> >>> is missing a Signed-off-by from its author. >> Good catch, Stephen! >> >> Lihao, would you please get me you Signed-off-by? The patch is below. >> >> Thanx, Paul >> >> ------------------------------------------------------------------------ >> >> commit d7e182c9c32480c1f579dd888ac50e88bfb39596 >> Author: Liang Lihao <lianglihao@huawei.com> So it's better to keep the author and Signed-off-by the same :) Thanks Hanjun
On 2017/11/29 11:14, Hanjun Guo wrote: > Hi Lihao, > > On 2017/11/29 10:48, Lihao Liang wrote: >> Hi Paul, >> >> Signed-off-by: Lihao Liang <lihao.liang@gmail.com> > > ... > >> >> Many thanks, >> Lihao. >> >> On 2017/11/29 9:14, Paul E. McKenney wrote: >>> On Wed, Nov 29, 2017 at 11:51:51AM +1100, Stephen Rothwell wrote: >>>> Hi Paul, >>>> >>>> Commit >>>> >>>> d7e182c9c324 ("rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()") >>>> >>>> is missing a Signed-off-by from its author. >>> Good catch, Stephen! >>> >>> Lihao, would you please get me you Signed-off-by? The patch is below. >>> >>> Thanx, Paul >>> >>> ------------------------------------------------------------------------ >>> >>> commit d7e182c9c32480c1f579dd888ac50e88bfb39596 >>> Author: Liang Lihao <lianglihao@huawei.com> > > So it's better to keep the author and Signed-off-by the same :) > Sure. Paul and Stephen, please use Signed-off-by: Lihao Liang <lianglihao@huawei.com> Many thanks, Lihao. > Thanks > Hanjun > > > . >
On Wed, Nov 29, 2017 at 11:29:03AM +0800, Lihao Liang wrote: > > > On 2017/11/29 11:14, Hanjun Guo wrote: > > Hi Lihao, > > > > On 2017/11/29 10:48, Lihao Liang wrote: > >> Hi Paul, > >> > >> Signed-off-by: Lihao Liang <lihao.liang@gmail.com> > > > > ... > > > >> > >> Many thanks, > >> Lihao. > >> > >> On 2017/11/29 9:14, Paul E. McKenney wrote: > >>> On Wed, Nov 29, 2017 at 11:51:51AM +1100, Stephen Rothwell wrote: > >>>> Hi Paul, > >>>> > >>>> Commit > >>>> > >>>> d7e182c9c324 ("rcu: Remove unnecessary spinlock in rcu_boot_init_percpu_data()") > >>>> > >>>> is missing a Signed-off-by from its author. > >>> Good catch, Stephen! > >>> > >>> Lihao, would you please get me you Signed-off-by? The patch is below. > >>> > >>> Thanx, Paul > >>> > >>> ------------------------------------------------------------------------ > >>> > >>> commit d7e182c9c32480c1f579dd888ac50e88bfb39596 > >>> Author: Liang Lihao <lianglihao@huawei.com> > > > > So it's better to keep the author and Signed-off-by the same :) > > > > Sure. Paul and Stephen, please use > > Signed-off-by: Lihao Liang <lianglihao@huawei.com> Updated, thank you both! Thanx, Paul > Many thanks, > Lihao. > > > Thanks > > Hanjun > > > > > > . > > >
[-- Attachment #1: Type: text/plain, Size: 185 bytes --] Hi Paul, Commit 2a84d1aef423 ("rcu: Inline rcu_preempt_do_callback() into its sole caller") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Tue, Feb 27, 2018 at 09:38:16AM +1100, Stephen Rothwell wrote:
> Hi Paul,
>
> Commit
>
> 2a84d1aef423 ("rcu: Inline rcu_preempt_do_callback() into its sole caller")
>
> is missing a Signed-off-by from its committer.
That would be because idiot here left the "-s" off of "git am"...
Apologies for the hassle, rebased to fix.
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 178 bytes --] Hi Paul, Commit bbf9d3657c39 ("doc: Ensure whatisRCU.txt actually says what RCU is") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Tue, Apr 24, 2018 at 07:48:44AM +1000, Stephen Rothwell wrote:
> Hi Paul,
>
> Commit
>
> bbf9d3657c39 ("doc: Ensure whatisRCU.txt actually says what RCU is")
>
> is missing a Signed-off-by from its committer.
Good catch, fixed!
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 501 bytes --] Hi all, Commits 51db3f987f62 ("Restore docs "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"") a0c1ba228721 ("Restore docs "treewide: Rename rcu_dereference_raw_notrace() to _check()"") 8b3b77cca47f ("Revert docs from "treewide: Rename rcu_dereference_raw_notrace() to _check()"") f7bf64a4ff9e ("Revert docs from "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"") are missing a Signed-off-by from their authors. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Tue, Oct 29, 2019 at 07:53:59AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Commits
>
> 51db3f987f62 ("Restore docs "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"")
> a0c1ba228721 ("Restore docs "treewide: Rename rcu_dereference_raw_notrace() to _check()"")
> 8b3b77cca47f ("Revert docs from "treewide: Rename rcu_dereference_raw_notrace() to _check()"")
> f7bf64a4ff9e ("Revert docs from "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"")
>
> are missing a Signed-off-by from their authors.
Again, good catch, thank you!
Joel, if you have any objections to my adding your Signed-off-by, please
let me know. (In which case, I will defer them to the v5.6 merge window,
which would allow us time to work out what to do instead.)
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 209 bytes --] Hi all, Commit 8e3a97174c3b ("doc: Add some more RCU list patterns in the kernel") is missing a Signed-off-by from its author (but does have an Co-developed-by). -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Thu, Feb 13, 2020 at 09:25:04AM +1100, Stephen Rothwell wrote: > Hi all, > > Commit > > 8e3a97174c3b ("doc: Add some more RCU list patterns in the kernel") > > is missing a Signed-off-by from its author (but does have an > Co-developed-by). Paul, I believe the issue is my SOB was missing from the patch, could you take the below patch instead which has to SOB? That should correct the issue in -next as they pull from your tree periodically right? Also I fixed Co-developed-by to be Amol. ---------8<---------- From: "Joel Fernandes (Google)" <joel@joelfernandes.org> Subject: [PATCH] doc: Add some more RCU list patterns in the kernel - Add more information about RCU list patterns taking examples from audit subsystem in the linux kernel. - Keep the current audit examples, even though the kernel has changed. - Modify inline text for better passage quality. - Fix typo in code-blocks and improve code comments. - Add text formatting (italics, bold and code) for better emphasis. Patch originally submitted at https://lore.kernel.org/patchwork/patch/1082804/ Co-developed-by: Amol Grover <frextrite@gmail.com> Signed-off-by: Amol Grover <frextrite@gmail.com> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> --- Documentation/RCU/listRCU.rst | 275 ++++++++++++++++++++++++++-------- 1 file changed, 211 insertions(+), 64 deletions(-) diff --git a/Documentation/RCU/listRCU.rst b/Documentation/RCU/listRCU.rst index 7956ff33042b0..55d2b30db481c 100644 --- a/Documentation/RCU/listRCU.rst +++ b/Documentation/RCU/listRCU.rst @@ -4,12 +4,61 @@ Using RCU to Protect Read-Mostly Linked Lists ============================================= One of the best applications of RCU is to protect read-mostly linked lists -("struct list_head" in list.h). One big advantage of this approach +(``struct list_head`` in list.h). One big advantage of this approach is that all of the required memory barriers are included for you in the list macros. This document describes several applications of RCU, with the best fits first. -Example 1: Read-Side Action Taken Outside of Lock, No In-Place Updates + +Example 1: Read-mostly list: Deferred Destruction +------------------------------------------------- + +A widely used usecase for RCU lists in the kernel is lockless iteration over +all processes in the system. ``task_struct::tasks`` represents the list node that +links all the processes. The list can be traversed in parallel to any list +additions or removals. + +The traversal of the list is done using ``for_each_process()`` which is defined +by the 2 macros:: + + #define next_task(p) \ + list_entry_rcu((p)->tasks.next, struct task_struct, tasks) + + #define for_each_process(p) \ + for (p = &init_task ; (p = next_task(p)) != &init_task ; ) + +The code traversing the list of all processes typically looks like:: + + rcu_read_lock(); + for_each_process(p) { + /* Do something with p */ + } + rcu_read_unlock(); + +The simplified code for removing a process from a task list is:: + + void release_task(struct task_struct *p) + { + write_lock(&tasklist_lock); + list_del_rcu(&p->tasks); + write_unlock(&tasklist_lock); + call_rcu(&p->rcu, delayed_put_task_struct); + } + +When a process exits, ``release_task()`` calls ``list_del_rcu(&p->tasks)`` under +``tasklist_lock`` writer lock protection, to remove the task from the list of +all tasks. The ``tasklist_lock`` prevents concurrent list additions/removals +from corrupting the list. Readers using ``for_each_process()`` are not protected +with the ``tasklist_lock``. To prevent readers from noticing changes in the list +pointers, the ``task_struct`` object is freed only after one or more grace +periods elapse (with the help of call_rcu()). This deferring of destruction +ensures that any readers traversing the list will see valid ``p->tasks.next`` +pointers and deletion/freeing can happen in parallel with traversal of the list. +This pattern is also called an **existence lock**, since RCU pins the object in +memory until all existing readers finish. + + +Example 2: Read-Side Action Taken Outside of Lock: No In-Place Updates ---------------------------------------------------------------------- The best applications are cases where, if reader-writer locking were @@ -26,7 +75,7 @@ added or deleted, rather than being modified in place. A straightforward example of this use of RCU may be found in the system-call auditing support. For example, a reader-writer locked -implementation of audit_filter_task() might be as follows:: +implementation of ``audit_filter_task()`` might be as follows:: static enum audit_state audit_filter_task(struct task_struct *tsk) { @@ -34,7 +83,7 @@ implementation of audit_filter_task() might be as follows:: enum audit_state state; read_lock(&auditsc_lock); - /* Note: audit_netlink_sem held by caller. */ + /* Note: audit_filter_mutex held by caller. */ list_for_each_entry(e, &audit_tsklist, list) { if (audit_filter_rules(tsk, &e->rule, NULL, &state)) { read_unlock(&auditsc_lock); @@ -58,7 +107,7 @@ This means that RCU can be easily applied to the read side, as follows:: enum audit_state state; rcu_read_lock(); - /* Note: audit_netlink_sem held by caller. */ + /* Note: audit_filter_mutex held by caller. */ list_for_each_entry_rcu(e, &audit_tsklist, list) { if (audit_filter_rules(tsk, &e->rule, NULL, &state)) { rcu_read_unlock(); @@ -69,18 +118,18 @@ This means that RCU can be easily applied to the read side, as follows:: return AUDIT_BUILD_CONTEXT; } -The read_lock() and read_unlock() calls have become rcu_read_lock() +The ``read_lock()`` and ``read_unlock()`` calls have become rcu_read_lock() and rcu_read_unlock(), respectively, and the list_for_each_entry() has -become list_for_each_entry_rcu(). The _rcu() list-traversal primitives +become list_for_each_entry_rcu(). The **_rcu()** list-traversal primitives insert the read-side memory barriers that are required on DEC Alpha CPUs. -The changes to the update side are also straightforward. A reader-writer -lock might be used as follows for deletion and insertion:: +The changes to the update side are also straightforward. A reader-writer lock +might be used as follows for deletion and insertion:: static inline int audit_del_rule(struct audit_rule *rule, struct list_head *list) { - struct audit_entry *e; + struct audit_entry *e; write_lock(&auditsc_lock); list_for_each_entry(e, list, list) { @@ -113,9 +162,9 @@ Following are the RCU equivalents for these two functions:: static inline int audit_del_rule(struct audit_rule *rule, struct list_head *list) { - struct audit_entry *e; + struct audit_entry *e; - /* Do not use the _rcu iterator here, since this is the only + /* No need to use the _rcu iterator here, since this is the only * deletion routine. */ list_for_each_entry(e, list, list) { if (!audit_compare_rule(rule, &e->rule)) { @@ -139,41 +188,41 @@ Following are the RCU equivalents for these two functions:: return 0; } -Normally, the write_lock() and write_unlock() would be replaced by -a spin_lock() and a spin_unlock(), but in this case, all callers hold -audit_netlink_sem, so no additional locking is required. The auditsc_lock -can therefore be eliminated, since use of RCU eliminates the need for -writers to exclude readers. Normally, the write_lock() calls would -be converted into spin_lock() calls. +Normally, the ``write_lock()`` and ``write_unlock()`` would be replaced by a +spin_lock() and a spin_unlock(). But in this case, all callers hold +``audit_filter_mutex``, so no additional locking is required. The +``auditsc_lock`` can therefore be eliminated, since use of RCU eliminates the +need for writers to exclude readers. The list_del(), list_add(), and list_add_tail() primitives have been replaced by list_del_rcu(), list_add_rcu(), and list_add_tail_rcu(). -The _rcu() list-manipulation primitives add memory barriers that are -needed on weakly ordered CPUs (most of them!). The list_del_rcu() -primitive omits the pointer poisoning debug-assist code that would -otherwise cause concurrent readers to fail spectacularly. +The **_rcu()** list-manipulation primitives add memory barriers that are needed on +weakly ordered CPUs (most of them!). The list_del_rcu() primitive omits the +pointer poisoning debug-assist code that would otherwise cause concurrent +readers to fail spectacularly. -So, when readers can tolerate stale data and when entries are either added -or deleted, without in-place modification, it is very easy to use RCU! +So, when readers can tolerate stale data and when entries are either added or +deleted, without in-place modification, it is very easy to use RCU! -Example 2: Handling In-Place Updates + +Example 3: Handling In-Place Updates ------------------------------------ -The system-call auditing code does not update auditing rules in place. -However, if it did, reader-writer-locked code to do so might look as -follows (presumably, the field_count is only permitted to decrease, -otherwise, the added fields would need to be filled in):: +The system-call auditing code does not update auditing rules in place. However, +if it did, the reader-writer-locked code to do so might look as follows +(assuming only ``field_count`` is updated, otherwise, the added fields would +need to be filled in):: static inline int audit_upd_rule(struct audit_rule *rule, struct list_head *list, __u32 newaction, __u32 newfield_count) { - struct audit_entry *e; - struct audit_newentry *ne; + struct audit_entry *e; + struct audit_entry *ne; write_lock(&auditsc_lock); - /* Note: audit_netlink_sem held by caller. */ + /* Note: audit_filter_mutex held by caller. */ list_for_each_entry(e, list, list) { if (!audit_compare_rule(rule, &e->rule)) { e->rule.action = newaction; @@ -188,16 +237,16 @@ otherwise, the added fields would need to be filled in):: The RCU version creates a copy, updates the copy, then replaces the old entry with the newly updated entry. This sequence of actions, allowing -concurrent reads while doing a copy to perform an update, is what gives -RCU ("read-copy update") its name. The RCU code is as follows:: +concurrent reads while making a copy to perform an update, is what gives +RCU (*read-copy update*) its name. The RCU code is as follows:: static inline int audit_upd_rule(struct audit_rule *rule, struct list_head *list, __u32 newaction, __u32 newfield_count) { - struct audit_entry *e; - struct audit_newentry *ne; + struct audit_entry *e; + struct audit_entry *ne; list_for_each_entry(e, list, list) { if (!audit_compare_rule(rule, &e->rule)) { @@ -215,34 +264,45 @@ RCU ("read-copy update") its name. The RCU code is as follows:: return -EFAULT; /* No matching rule */ } -Again, this assumes that the caller holds audit_netlink_sem. Normally, -the reader-writer lock would become a spinlock in this sort of code. +Again, this assumes that the caller holds ``audit_filter_mutex``. Normally, the +writer lock would become a spinlock in this sort of code. -Example 3: Eliminating Stale Data +Another use of this pattern can be found in the openswitch driver's *connection +tracking table* code in ``ct_limit_set()``. The table holds connection tracking +entries and has a limit on the maximum entries. There is one such table +per-zone and hence one *limit* per zone. The zones are mapped to their limits +through a hashtable using an RCU-managed hlist for the hash chains. When a new +limit is set, a new limit object is allocated and ``ct_limit_set()`` is called +to replace the old limit object with the new one using list_replace_rcu(). +The old limit object is then freed after a grace period using kfree_rcu(). + + +Example 4: Eliminating Stale Data --------------------------------- -The auditing examples above tolerate stale data, as do most algorithms +The auditing example above tolerates stale data, as do most algorithms that are tracking external state. Because there is a delay from the time the external state changes before Linux becomes aware of the change, -additional RCU-induced staleness is normally not a problem. +additional RCU-induced staleness is generally not a problem. However, there are many examples where stale data cannot be tolerated. One example in the Linux kernel is the System V IPC (see the ipc_lock() -function in ipc/util.c). This code checks a "deleted" flag under a -per-entry spinlock, and, if the "deleted" flag is set, pretends that the +function in ipc/util.c). This code checks a *deleted* flag under a +per-entry spinlock, and, if the *deleted* flag is set, pretends that the entry does not exist. For this to be helpful, the search function must -return holding the per-entry spinlock, as ipc_lock() does in fact do. +return holding the per-entry lock, as ipc_lock() does in fact do. + +.. _quick_quiz: Quick Quiz: - Why does the search function need to return holding the per-entry lock for - this deleted-flag technique to be helpful? + For the deleted-flag technique to be helpful, why is it necessary + to hold the per-entry lock while returning from the search function? -:ref:`Answer to Quick Quiz <answer_quick_quiz_list>` +:ref:`Answer to Quick Quiz <quick_quiz_answer>` -If the system-call audit module were to ever need to reject stale data, -one way to accomplish this would be to add a "deleted" flag and a "lock" -spinlock to the audit_entry structure, and modify audit_filter_task() -as follows:: +If the system-call audit module were to ever need to reject stale data, one way +to accomplish this would be to add a ``deleted`` flag and a ``lock`` spinlock to the +audit_entry structure, and modify ``audit_filter_task()`` as follows:: static enum audit_state audit_filter_task(struct task_struct *tsk) { @@ -267,20 +327,20 @@ as follows:: } Note that this example assumes that entries are only added and deleted. -Additional mechanism is required to deal correctly with the -update-in-place performed by audit_upd_rule(). For one thing, -audit_upd_rule() would need additional memory barriers to ensure -that the list_add_rcu() was really executed before the list_del_rcu(). +Additional mechanism is required to deal correctly with the update-in-place +performed by ``audit_upd_rule()``. For one thing, ``audit_upd_rule()`` would +need additional memory barriers to ensure that the list_add_rcu() was really +executed before the list_del_rcu(). -The audit_del_rule() function would need to set the "deleted" -flag under the spinlock as follows:: +The ``audit_del_rule()`` function would need to set the ``deleted`` flag under the +spinlock as follows:: static inline int audit_del_rule(struct audit_rule *rule, struct list_head *list) { - struct audit_entry *e; + struct audit_entry *e; - /* Do not need to use the _rcu iterator here, since this + /* No need to use the _rcu iterator here, since this * is the only deletion routine. */ list_for_each_entry(e, list, list) { if (!audit_compare_rule(rule, &e->rule)) { @@ -295,6 +355,91 @@ flag under the spinlock as follows:: return -EFAULT; /* No matching rule */ } +This too assumes that the caller holds ``audit_filter_mutex``. + + +Example 5: Skipping Stale Objects +--------------------------------- + +For some usecases, reader performance can be improved by skipping stale objects +during read-side list traversal if the object in concern is pending destruction +after one or more grace periods. One such example can be found in the timerfd +subsystem. When a ``CLOCK_REALTIME`` clock is reprogrammed - for example due to +setting of the system time, then all programmed timerfds that depend on this +clock get triggered and processes waiting on them to expire are woken up in +advance of their scheduled expiry. To facilitate this, all such timers are added +to an RCU-managed ``cancel_list`` when they are setup in +``timerfd_setup_cancel()``:: + + static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags) + { + spin_lock(&ctx->cancel_lock); + if ((ctx->clockid == CLOCK_REALTIME && + (flags & TFD_TIMER_ABSTIME) && (flags & TFD_TIMER_CANCEL_ON_SET)) { + if (!ctx->might_cancel) { + ctx->might_cancel = true; + spin_lock(&cancel_lock); + list_add_rcu(&ctx->clist, &cancel_list); + spin_unlock(&cancel_lock); + } + } + spin_unlock(&ctx->cancel_lock); + } + +When a timerfd is freed (fd is closed), then the ``might_cancel`` flag of the +timerfd object is cleared, the object removed from the ``cancel_list`` and +destroyed:: + + int timerfd_release(struct inode *inode, struct file *file) + { + struct timerfd_ctx *ctx = file->private_data; + + spin_lock(&ctx->cancel_lock); + if (ctx->might_cancel) { + ctx->might_cancel = false; + spin_lock(&cancel_lock); + list_del_rcu(&ctx->clist); + spin_unlock(&cancel_lock); + } + spin_unlock(&ctx->cancel_lock); + + hrtimer_cancel(&ctx->t.tmr); + kfree_rcu(ctx, rcu); + return 0; + } + +If the ``CLOCK_REALTIME`` clock is set, for example by a time server, the +hrtimer framework calls ``timerfd_clock_was_set()`` which walks the +``cancel_list`` and wakes up processes waiting on the timerfd. While iterating +the ``cancel_list``, the ``might_cancel`` flag is consulted to skip stale +objects:: + + void timerfd_clock_was_set(void) + { + struct timerfd_ctx *ctx; + unsigned long flags; + + rcu_read_lock(); + list_for_each_entry_rcu(ctx, &cancel_list, clist) { + if (!ctx->might_cancel) + continue; + spin_lock_irqsave(&ctx->wqh.lock, flags); + if (ctx->moffs != ktime_mono_to_real(0)) { + ctx->moffs = KTIME_MAX; + ctx->ticks++; + wake_up_locked_poll(&ctx->wqh, EPOLLIN); + } + spin_unlock_irqrestore(&ctx->wqh.lock, flags); + } + rcu_read_unlock(); + } + +The key point here is, because RCU-traversal of the ``cancel_list`` happens +while objects are being added and removed to the list, sometimes the traversal +can step on an object that has been removed from the list. In this example, it +is seen that it is better to skip such objects using a flag. + + Summary ------- @@ -303,19 +448,21 @@ the most amenable to use of RCU. The simplest case is where entries are either added or deleted from the data structure (or atomically modified in place), but non-atomic in-place modifications can be handled by making a copy, updating the copy, then replacing the original with the copy. -If stale data cannot be tolerated, then a "deleted" flag may be used +If stale data cannot be tolerated, then a *deleted* flag may be used in conjunction with a per-entry spinlock in order to allow the search function to reject newly deleted data. -.. _answer_quick_quiz_list: +.. _quick_quiz_answer: Answer to Quick Quiz: - Why does the search function need to return holding the per-entry - lock for this deleted-flag technique to be helpful? + For the deleted-flag technique to be helpful, why is it necessary + to hold the per-entry lock while returning from the search function? If the search function drops the per-entry lock before returning, then the caller will be processing stale data in any case. If it is really OK to be processing stale data, then you don't need a - "deleted" flag. If processing stale data really is a problem, + *deleted* flag. If processing stale data really is a problem, then you need to hold the per-entry lock across all of the code that uses the value that was returned. + +:ref:`Back to Quick Quiz <quick_quiz>` -- 2.25.0.265.gbab2e86ba0-goog
On Thu, Feb 13, 2020 at 04:38:21PM -0500, Joel Fernandes wrote: > On Thu, Feb 13, 2020 at 09:25:04AM +1100, Stephen Rothwell wrote: > > Hi all, > > > > Commit > > > > 8e3a97174c3b ("doc: Add some more RCU list patterns in the kernel") > > > > is missing a Signed-off-by from its author (but does have an > > Co-developed-by). > > Paul, I believe the issue is my SOB was missing from the patch, could you > take the below patch instead which has to SOB? That should correct the issue > in -next as they pull from your tree periodically right? Also I fixed > Co-developed-by to be Amol. Done! Here is hoping that it passes muster. ;-) Thanx, Paul > ---------8<---------- > From: "Joel Fernandes (Google)" <joel@joelfernandes.org> > Subject: [PATCH] doc: Add some more RCU list patterns in the kernel > > - Add more information about RCU list patterns taking examples > from audit subsystem in the linux kernel. > > - Keep the current audit examples, even though the kernel has changed. > > - Modify inline text for better passage quality. > > - Fix typo in code-blocks and improve code comments. > > - Add text formatting (italics, bold and code) for better emphasis. > > Patch originally submitted at > https://lore.kernel.org/patchwork/patch/1082804/ > > Co-developed-by: Amol Grover <frextrite@gmail.com> > Signed-off-by: Amol Grover <frextrite@gmail.com> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > --- > Documentation/RCU/listRCU.rst | 275 ++++++++++++++++++++++++++-------- > 1 file changed, 211 insertions(+), 64 deletions(-) > > diff --git a/Documentation/RCU/listRCU.rst b/Documentation/RCU/listRCU.rst > index 7956ff33042b0..55d2b30db481c 100644 > --- a/Documentation/RCU/listRCU.rst > +++ b/Documentation/RCU/listRCU.rst > @@ -4,12 +4,61 @@ Using RCU to Protect Read-Mostly Linked Lists > ============================================= > > One of the best applications of RCU is to protect read-mostly linked lists > -("struct list_head" in list.h). One big advantage of this approach > +(``struct list_head`` in list.h). One big advantage of this approach > is that all of the required memory barriers are included for you in > the list macros. This document describes several applications of RCU, > with the best fits first. > > -Example 1: Read-Side Action Taken Outside of Lock, No In-Place Updates > + > +Example 1: Read-mostly list: Deferred Destruction > +------------------------------------------------- > + > +A widely used usecase for RCU lists in the kernel is lockless iteration over > +all processes in the system. ``task_struct::tasks`` represents the list node that > +links all the processes. The list can be traversed in parallel to any list > +additions or removals. > + > +The traversal of the list is done using ``for_each_process()`` which is defined > +by the 2 macros:: > + > + #define next_task(p) \ > + list_entry_rcu((p)->tasks.next, struct task_struct, tasks) > + > + #define for_each_process(p) \ > + for (p = &init_task ; (p = next_task(p)) != &init_task ; ) > + > +The code traversing the list of all processes typically looks like:: > + > + rcu_read_lock(); > + for_each_process(p) { > + /* Do something with p */ > + } > + rcu_read_unlock(); > + > +The simplified code for removing a process from a task list is:: > + > + void release_task(struct task_struct *p) > + { > + write_lock(&tasklist_lock); > + list_del_rcu(&p->tasks); > + write_unlock(&tasklist_lock); > + call_rcu(&p->rcu, delayed_put_task_struct); > + } > + > +When a process exits, ``release_task()`` calls ``list_del_rcu(&p->tasks)`` under > +``tasklist_lock`` writer lock protection, to remove the task from the list of > +all tasks. The ``tasklist_lock`` prevents concurrent list additions/removals > +from corrupting the list. Readers using ``for_each_process()`` are not protected > +with the ``tasklist_lock``. To prevent readers from noticing changes in the list > +pointers, the ``task_struct`` object is freed only after one or more grace > +periods elapse (with the help of call_rcu()). This deferring of destruction > +ensures that any readers traversing the list will see valid ``p->tasks.next`` > +pointers and deletion/freeing can happen in parallel with traversal of the list. > +This pattern is also called an **existence lock**, since RCU pins the object in > +memory until all existing readers finish. > + > + > +Example 2: Read-Side Action Taken Outside of Lock: No In-Place Updates > ---------------------------------------------------------------------- > > The best applications are cases where, if reader-writer locking were > @@ -26,7 +75,7 @@ added or deleted, rather than being modified in place. > > A straightforward example of this use of RCU may be found in the > system-call auditing support. For example, a reader-writer locked > -implementation of audit_filter_task() might be as follows:: > +implementation of ``audit_filter_task()`` might be as follows:: > > static enum audit_state audit_filter_task(struct task_struct *tsk) > { > @@ -34,7 +83,7 @@ implementation of audit_filter_task() might be as follows:: > enum audit_state state; > > read_lock(&auditsc_lock); > - /* Note: audit_netlink_sem held by caller. */ > + /* Note: audit_filter_mutex held by caller. */ > list_for_each_entry(e, &audit_tsklist, list) { > if (audit_filter_rules(tsk, &e->rule, NULL, &state)) { > read_unlock(&auditsc_lock); > @@ -58,7 +107,7 @@ This means that RCU can be easily applied to the read side, as follows:: > enum audit_state state; > > rcu_read_lock(); > - /* Note: audit_netlink_sem held by caller. */ > + /* Note: audit_filter_mutex held by caller. */ > list_for_each_entry_rcu(e, &audit_tsklist, list) { > if (audit_filter_rules(tsk, &e->rule, NULL, &state)) { > rcu_read_unlock(); > @@ -69,18 +118,18 @@ This means that RCU can be easily applied to the read side, as follows:: > return AUDIT_BUILD_CONTEXT; > } > > -The read_lock() and read_unlock() calls have become rcu_read_lock() > +The ``read_lock()`` and ``read_unlock()`` calls have become rcu_read_lock() > and rcu_read_unlock(), respectively, and the list_for_each_entry() has > -become list_for_each_entry_rcu(). The _rcu() list-traversal primitives > +become list_for_each_entry_rcu(). The **_rcu()** list-traversal primitives > insert the read-side memory barriers that are required on DEC Alpha CPUs. > > -The changes to the update side are also straightforward. A reader-writer > -lock might be used as follows for deletion and insertion:: > +The changes to the update side are also straightforward. A reader-writer lock > +might be used as follows for deletion and insertion:: > > static inline int audit_del_rule(struct audit_rule *rule, > struct list_head *list) > { > - struct audit_entry *e; > + struct audit_entry *e; > > write_lock(&auditsc_lock); > list_for_each_entry(e, list, list) { > @@ -113,9 +162,9 @@ Following are the RCU equivalents for these two functions:: > static inline int audit_del_rule(struct audit_rule *rule, > struct list_head *list) > { > - struct audit_entry *e; > + struct audit_entry *e; > > - /* Do not use the _rcu iterator here, since this is the only > + /* No need to use the _rcu iterator here, since this is the only > * deletion routine. */ > list_for_each_entry(e, list, list) { > if (!audit_compare_rule(rule, &e->rule)) { > @@ -139,41 +188,41 @@ Following are the RCU equivalents for these two functions:: > return 0; > } > > -Normally, the write_lock() and write_unlock() would be replaced by > -a spin_lock() and a spin_unlock(), but in this case, all callers hold > -audit_netlink_sem, so no additional locking is required. The auditsc_lock > -can therefore be eliminated, since use of RCU eliminates the need for > -writers to exclude readers. Normally, the write_lock() calls would > -be converted into spin_lock() calls. > +Normally, the ``write_lock()`` and ``write_unlock()`` would be replaced by a > +spin_lock() and a spin_unlock(). But in this case, all callers hold > +``audit_filter_mutex``, so no additional locking is required. The > +``auditsc_lock`` can therefore be eliminated, since use of RCU eliminates the > +need for writers to exclude readers. > > The list_del(), list_add(), and list_add_tail() primitives have been > replaced by list_del_rcu(), list_add_rcu(), and list_add_tail_rcu(). > -The _rcu() list-manipulation primitives add memory barriers that are > -needed on weakly ordered CPUs (most of them!). The list_del_rcu() > -primitive omits the pointer poisoning debug-assist code that would > -otherwise cause concurrent readers to fail spectacularly. > +The **_rcu()** list-manipulation primitives add memory barriers that are needed on > +weakly ordered CPUs (most of them!). The list_del_rcu() primitive omits the > +pointer poisoning debug-assist code that would otherwise cause concurrent > +readers to fail spectacularly. > > -So, when readers can tolerate stale data and when entries are either added > -or deleted, without in-place modification, it is very easy to use RCU! > +So, when readers can tolerate stale data and when entries are either added or > +deleted, without in-place modification, it is very easy to use RCU! > > -Example 2: Handling In-Place Updates > + > +Example 3: Handling In-Place Updates > ------------------------------------ > > -The system-call auditing code does not update auditing rules in place. > -However, if it did, reader-writer-locked code to do so might look as > -follows (presumably, the field_count is only permitted to decrease, > -otherwise, the added fields would need to be filled in):: > +The system-call auditing code does not update auditing rules in place. However, > +if it did, the reader-writer-locked code to do so might look as follows > +(assuming only ``field_count`` is updated, otherwise, the added fields would > +need to be filled in):: > > static inline int audit_upd_rule(struct audit_rule *rule, > struct list_head *list, > __u32 newaction, > __u32 newfield_count) > { > - struct audit_entry *e; > - struct audit_newentry *ne; > + struct audit_entry *e; > + struct audit_entry *ne; > > write_lock(&auditsc_lock); > - /* Note: audit_netlink_sem held by caller. */ > + /* Note: audit_filter_mutex held by caller. */ > list_for_each_entry(e, list, list) { > if (!audit_compare_rule(rule, &e->rule)) { > e->rule.action = newaction; > @@ -188,16 +237,16 @@ otherwise, the added fields would need to be filled in):: > > The RCU version creates a copy, updates the copy, then replaces the old > entry with the newly updated entry. This sequence of actions, allowing > -concurrent reads while doing a copy to perform an update, is what gives > -RCU ("read-copy update") its name. The RCU code is as follows:: > +concurrent reads while making a copy to perform an update, is what gives > +RCU (*read-copy update*) its name. The RCU code is as follows:: > > static inline int audit_upd_rule(struct audit_rule *rule, > struct list_head *list, > __u32 newaction, > __u32 newfield_count) > { > - struct audit_entry *e; > - struct audit_newentry *ne; > + struct audit_entry *e; > + struct audit_entry *ne; > > list_for_each_entry(e, list, list) { > if (!audit_compare_rule(rule, &e->rule)) { > @@ -215,34 +264,45 @@ RCU ("read-copy update") its name. The RCU code is as follows:: > return -EFAULT; /* No matching rule */ > } > > -Again, this assumes that the caller holds audit_netlink_sem. Normally, > -the reader-writer lock would become a spinlock in this sort of code. > +Again, this assumes that the caller holds ``audit_filter_mutex``. Normally, the > +writer lock would become a spinlock in this sort of code. > > -Example 3: Eliminating Stale Data > +Another use of this pattern can be found in the openswitch driver's *connection > +tracking table* code in ``ct_limit_set()``. The table holds connection tracking > +entries and has a limit on the maximum entries. There is one such table > +per-zone and hence one *limit* per zone. The zones are mapped to their limits > +through a hashtable using an RCU-managed hlist for the hash chains. When a new > +limit is set, a new limit object is allocated and ``ct_limit_set()`` is called > +to replace the old limit object with the new one using list_replace_rcu(). > +The old limit object is then freed after a grace period using kfree_rcu(). > + > + > +Example 4: Eliminating Stale Data > --------------------------------- > > -The auditing examples above tolerate stale data, as do most algorithms > +The auditing example above tolerates stale data, as do most algorithms > that are tracking external state. Because there is a delay from the > time the external state changes before Linux becomes aware of the change, > -additional RCU-induced staleness is normally not a problem. > +additional RCU-induced staleness is generally not a problem. > > However, there are many examples where stale data cannot be tolerated. > One example in the Linux kernel is the System V IPC (see the ipc_lock() > -function in ipc/util.c). This code checks a "deleted" flag under a > -per-entry spinlock, and, if the "deleted" flag is set, pretends that the > +function in ipc/util.c). This code checks a *deleted* flag under a > +per-entry spinlock, and, if the *deleted* flag is set, pretends that the > entry does not exist. For this to be helpful, the search function must > -return holding the per-entry spinlock, as ipc_lock() does in fact do. > +return holding the per-entry lock, as ipc_lock() does in fact do. > + > +.. _quick_quiz: > > Quick Quiz: > - Why does the search function need to return holding the per-entry lock for > - this deleted-flag technique to be helpful? > + For the deleted-flag technique to be helpful, why is it necessary > + to hold the per-entry lock while returning from the search function? > > -:ref:`Answer to Quick Quiz <answer_quick_quiz_list>` > +:ref:`Answer to Quick Quiz <quick_quiz_answer>` > > -If the system-call audit module were to ever need to reject stale data, > -one way to accomplish this would be to add a "deleted" flag and a "lock" > -spinlock to the audit_entry structure, and modify audit_filter_task() > -as follows:: > +If the system-call audit module were to ever need to reject stale data, one way > +to accomplish this would be to add a ``deleted`` flag and a ``lock`` spinlock to the > +audit_entry structure, and modify ``audit_filter_task()`` as follows:: > > static enum audit_state audit_filter_task(struct task_struct *tsk) > { > @@ -267,20 +327,20 @@ as follows:: > } > > Note that this example assumes that entries are only added and deleted. > -Additional mechanism is required to deal correctly with the > -update-in-place performed by audit_upd_rule(). For one thing, > -audit_upd_rule() would need additional memory barriers to ensure > -that the list_add_rcu() was really executed before the list_del_rcu(). > +Additional mechanism is required to deal correctly with the update-in-place > +performed by ``audit_upd_rule()``. For one thing, ``audit_upd_rule()`` would > +need additional memory barriers to ensure that the list_add_rcu() was really > +executed before the list_del_rcu(). > > -The audit_del_rule() function would need to set the "deleted" > -flag under the spinlock as follows:: > +The ``audit_del_rule()`` function would need to set the ``deleted`` flag under the > +spinlock as follows:: > > static inline int audit_del_rule(struct audit_rule *rule, > struct list_head *list) > { > - struct audit_entry *e; > + struct audit_entry *e; > > - /* Do not need to use the _rcu iterator here, since this > + /* No need to use the _rcu iterator here, since this > * is the only deletion routine. */ > list_for_each_entry(e, list, list) { > if (!audit_compare_rule(rule, &e->rule)) { > @@ -295,6 +355,91 @@ flag under the spinlock as follows:: > return -EFAULT; /* No matching rule */ > } > > +This too assumes that the caller holds ``audit_filter_mutex``. > + > + > +Example 5: Skipping Stale Objects > +--------------------------------- > + > +For some usecases, reader performance can be improved by skipping stale objects > +during read-side list traversal if the object in concern is pending destruction > +after one or more grace periods. One such example can be found in the timerfd > +subsystem. When a ``CLOCK_REALTIME`` clock is reprogrammed - for example due to > +setting of the system time, then all programmed timerfds that depend on this > +clock get triggered and processes waiting on them to expire are woken up in > +advance of their scheduled expiry. To facilitate this, all such timers are added > +to an RCU-managed ``cancel_list`` when they are setup in > +``timerfd_setup_cancel()``:: > + > + static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags) > + { > + spin_lock(&ctx->cancel_lock); > + if ((ctx->clockid == CLOCK_REALTIME && > + (flags & TFD_TIMER_ABSTIME) && (flags & TFD_TIMER_CANCEL_ON_SET)) { > + if (!ctx->might_cancel) { > + ctx->might_cancel = true; > + spin_lock(&cancel_lock); > + list_add_rcu(&ctx->clist, &cancel_list); > + spin_unlock(&cancel_lock); > + } > + } > + spin_unlock(&ctx->cancel_lock); > + } > + > +When a timerfd is freed (fd is closed), then the ``might_cancel`` flag of the > +timerfd object is cleared, the object removed from the ``cancel_list`` and > +destroyed:: > + > + int timerfd_release(struct inode *inode, struct file *file) > + { > + struct timerfd_ctx *ctx = file->private_data; > + > + spin_lock(&ctx->cancel_lock); > + if (ctx->might_cancel) { > + ctx->might_cancel = false; > + spin_lock(&cancel_lock); > + list_del_rcu(&ctx->clist); > + spin_unlock(&cancel_lock); > + } > + spin_unlock(&ctx->cancel_lock); > + > + hrtimer_cancel(&ctx->t.tmr); > + kfree_rcu(ctx, rcu); > + return 0; > + } > + > +If the ``CLOCK_REALTIME`` clock is set, for example by a time server, the > +hrtimer framework calls ``timerfd_clock_was_set()`` which walks the > +``cancel_list`` and wakes up processes waiting on the timerfd. While iterating > +the ``cancel_list``, the ``might_cancel`` flag is consulted to skip stale > +objects:: > + > + void timerfd_clock_was_set(void) > + { > + struct timerfd_ctx *ctx; > + unsigned long flags; > + > + rcu_read_lock(); > + list_for_each_entry_rcu(ctx, &cancel_list, clist) { > + if (!ctx->might_cancel) > + continue; > + spin_lock_irqsave(&ctx->wqh.lock, flags); > + if (ctx->moffs != ktime_mono_to_real(0)) { > + ctx->moffs = KTIME_MAX; > + ctx->ticks++; > + wake_up_locked_poll(&ctx->wqh, EPOLLIN); > + } > + spin_unlock_irqrestore(&ctx->wqh.lock, flags); > + } > + rcu_read_unlock(); > + } > + > +The key point here is, because RCU-traversal of the ``cancel_list`` happens > +while objects are being added and removed to the list, sometimes the traversal > +can step on an object that has been removed from the list. In this example, it > +is seen that it is better to skip such objects using a flag. > + > + > Summary > ------- > > @@ -303,19 +448,21 @@ the most amenable to use of RCU. The simplest case is where entries are > either added or deleted from the data structure (or atomically modified > in place), but non-atomic in-place modifications can be handled by making > a copy, updating the copy, then replacing the original with the copy. > -If stale data cannot be tolerated, then a "deleted" flag may be used > +If stale data cannot be tolerated, then a *deleted* flag may be used > in conjunction with a per-entry spinlock in order to allow the search > function to reject newly deleted data. > > -.. _answer_quick_quiz_list: > +.. _quick_quiz_answer: > > Answer to Quick Quiz: > - Why does the search function need to return holding the per-entry > - lock for this deleted-flag technique to be helpful? > + For the deleted-flag technique to be helpful, why is it necessary > + to hold the per-entry lock while returning from the search function? > > If the search function drops the per-entry lock before returning, > then the caller will be processing stale data in any case. If it > is really OK to be processing stale data, then you don't need a > - "deleted" flag. If processing stale data really is a problem, > + *deleted* flag. If processing stale data really is a problem, > then you need to hold the per-entry lock across all of the code > that uses the value that was returned. > + > +:ref:`Back to Quick Quiz <quick_quiz>` > -- > 2.25.0.265.gbab2e86ba0-goog >
[-- Attachment #1: Type: text/plain, Size: 404 bytes --] Hi all, Commit 903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled") is missing a Signed-off-by from its author and committer. I didn't complain about this when it was first present because I figured it was just a debugging commit that would be removed quickly. However, there are now quite a few follow up commits ... -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Thu, Sep 17, 2020 at 01:26:52PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> 903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled")
>
> is missing a Signed-off-by from its author and committer.
>
> I didn't complain about this when it was first present because I figured
> it was just a debugging commit that would be removed quickly. However,
> there are now quite a few follow up commits ...
Without Peter's Signed-off-by, I clearly won't be submitting it to the
upcoming merge window.
Peter, this is now quite close to your original patch. May I please
add your Signed-off-by?
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 853 bytes --] Hi Paul, On Thu, 17 Sep 2020 11:00:05 -0700 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > On Thu, Sep 17, 2020 at 01:26:52PM +1000, Stephen Rothwell wrote: > > > > Commit > > > > 903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled") > > > > is missing a Signed-off-by from its author and committer. > > > > I didn't complain about this when it was first present because I figured > > it was just a debugging commit that would be removed quickly. However, > > there are now quite a few follow up commits ... > > Without Peter's Signed-off-by, I clearly won't be submitting it to the > upcoming merge window. > > Peter, this is now quite close to your original patch. May I please > add your Signed-off-by? Rebased today, but still no SOB lines. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Thu, Sep 17, 2020 at 11:00:05AM -0700, Paul E. McKenney wrote:
> On Thu, Sep 17, 2020 at 01:26:52PM +1000, Stephen Rothwell wrote:
> > Hi all,
> >
> > Commit
> >
> > 903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled")
> >
> > is missing a Signed-off-by from its author and committer.
> >
> > I didn't complain about this when it was first present because I figured
> > it was just a debugging commit that would be removed quickly. However,
> > there are now quite a few follow up commits ...
>
> Without Peter's Signed-off-by, I clearly won't be submitting it to the
> upcoming merge window.
>
> Peter, this is now quite close to your original patch. May I please
> add your Signed-off-by?
Sure!
On Mon, Sep 28, 2020 at 09:57:29AM +0200, Peter Zijlstra wrote:
> On Thu, Sep 17, 2020 at 11:00:05AM -0700, Paul E. McKenney wrote:
> > On Thu, Sep 17, 2020 at 01:26:52PM +1000, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > Commit
> > >
> > > 903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled")
> > >
> > > is missing a Signed-off-by from its author and committer.
> > >
> > > I didn't complain about this when it was first present because I figured
> > > it was just a debugging commit that would be removed quickly. However,
> > > there are now quite a few follow up commits ...
> >
> > Without Peter's Signed-off-by, I clearly won't be submitting it to the
> > upcoming merge window.
> >
> > Peter, this is now quite close to your original patch. May I please
> > add your Signed-off-by?
>
> Sure!
Much appreciated!!!
But I already replaced that commit with one that moves the call to
try_invoke_on_locked_down_task() an interrupts-enabled region of code.
Which is probably what I should have done to start with... :-/
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 179 bytes --] Hi all, Commit 5f5f44ca646f ("EXP Revert "KVM: Check the allocation of pv cpu mask"") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Wed, Sep 30, 2020 at 08:37:17AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> 5f5f44ca646f ("EXP Revert "KVM: Check the allocation of pv cpu mask"")
>
> is missing a Signed-off-by from its committer.
Good catch, fixed in current rcu/next, and apologies for the bother!
Thanx, Paul
On Mon, Sep 28, 2020 at 10:33:13AM -0700, Paul E. McKenney wrote: > On Mon, Sep 28, 2020 at 09:57:29AM +0200, Peter Zijlstra wrote: > > On Thu, Sep 17, 2020 at 11:00:05AM -0700, Paul E. McKenney wrote: > > > On Thu, Sep 17, 2020 at 01:26:52PM +1000, Stephen Rothwell wrote: > > > > Hi all, > > > > > > > > Commit > > > > > > > > 903c5302fa2d ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled") > > > > > > > > is missing a Signed-off-by from its author and committer. > > > > > > > > I didn't complain about this when it was first present because I figured > > > > it was just a debugging commit that would be removed quickly. However, > > > > there are now quite a few follow up commits ... > > > > > > Without Peter's Signed-off-by, I clearly won't be submitting it to the > > > upcoming merge window. > > > > > > Peter, this is now quite close to your original patch. May I please > > > add your Signed-off-by? > > > > Sure! > > Much appreciated!!! > > But I already replaced that commit with one that moves the call to > try_invoke_on_locked_down_task() an interrupts-enabled region of code. > Which is probably what I should have done to start with... :-/ Except that Marco Elver is making that fail, so I am resuscitating your patch with your Signed-off-by, as shown below. So once again, much appreciated!!! Thanx, Paul ------------------------------------------------------------------------ commit 444ef3bbd0f243b912fdfd51f326704f8ee872bf Author: Peter Zijlstra <peterz@infradead.org> Date: Sat Aug 29 10:22:24 2020 -0700 sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled The try_invoke_on_locked_down_task() function currently requires that interrupts be enabled, but it is called with interrupts disabled from rcu_print_task_stall(), resulting in an "IRQs not enabled as expected" diagnostic. This commit therefore updates try_invoke_on_locked_down_task() to use raw_spin_lock_irqsave() instead of raw_spin_lock_irq(), thus allowing use from either context. Link: https://lore.kernel.org/lkml/000000000000903d5805ab908fc4@google.com/ Link: https://lore.kernel.org/lkml/20200928075729.GC2611@hirez.programming.kicks-ass.net/ Reported-by: syzbot+cb3b69ae80afd6535b0e@syzkaller.appspotmail.com Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> diff --git a/kernel/sched/core.c b/kernel/sched/core.c index e172f2d..09ef5cf 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2984,7 +2984,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) /** * try_invoke_on_locked_down_task - Invoke a function on task in fixed state - * @p: Process for which the function is to be invoked. + * @p: Process for which the function is to be invoked, can be @current. * @func: Function to invoke. * @arg: Argument to function. * @@ -3002,12 +3002,11 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) */ bool try_invoke_on_locked_down_task(struct task_struct *p, bool (*func)(struct task_struct *t, void *arg), void *arg) { - bool ret = false; struct rq_flags rf; + bool ret = false; struct rq *rq; - lockdep_assert_irqs_enabled(); - raw_spin_lock_irq(&p->pi_lock); + raw_spin_lock_irqsave(&p->pi_lock, rf.flags); if (p->on_rq) { rq = __task_rq_lock(p, &rf); if (task_rq(p) == rq) @@ -3024,7 +3023,7 @@ bool try_invoke_on_locked_down_task(struct task_struct *p, bool (*func)(struct t ret = func(p, arg); } } - raw_spin_unlock_irq(&p->pi_lock); + raw_spin_unlock_irqrestore(&p->pi_lock, rf.flags); return ret; }
[-- Attachment #1: Type: text/plain, Size: 326 bytes --] Hi all, Commit ca3bd09a3a49 ("rcu: Allow rcu_irq_enter_check_tick() from NMI") is missing a Signed-off-by from its author. Commit 00dc4fd2297c ("tools/rcutorture: Make identify_qemu_vcpus() independent of local language") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #1: Type: text/plain, Size: 296 bytes --] Hi all, On Sun, 22 Nov 2020 21:08:10 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Commit > > ca3bd09a3a49 ("rcu: Allow rcu_irq_enter_check_tick() from NMI") > > is missing a Signed-off-by from its author. Please ignore this bit. dd -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Sun, Nov 22, 2020 at 09:09:13PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> On Sun, 22 Nov 2020 21:08:10 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Commit
> >
> > ca3bd09a3a49 ("rcu: Allow rcu_irq_enter_check_tick() from NMI")
> >
> > is missing a Signed-off-by from its author.
>
> Please ignore this bit.
> dd
But good catch on the other one, will fix!
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 758 bytes --] Hi all, Commit cffdc9c7c24c ("EXP sched: Print list of runnable tasks in the current rq") is missing a Signed-off-by from its author. Paul, remember the rules for -next: You will need to ensure that the patches/commits in your tree/series have been: * submitted under GPL v2 (or later) and include the Contributor's Signed-off-by, * posted to the relevant mailing list, * reviewed by you (or another maintainer of your subsystem tree), * successfully unit tested, and * destined for the current or next Linux merge window. Basically, this should be just what you would send to Linus (or ask him to fetch). It is allowed to be rebased if you deem it necessary. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Sun, Jan 10, 2021 at 01:24:32PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> cffdc9c7c24c ("EXP sched: Print list of runnable tasks in the current rq")
>
> is missing a Signed-off-by from its author.
>
> Paul, remember the rules for -next:
>
> You will need to ensure that the patches/commits in your tree/series have
> been:
> * submitted under GPL v2 (or later) and include the Contributor's
> Signed-off-by,
> * posted to the relevant mailing list,
> * reviewed by you (or another maintainer of your subsystem tree),
> * successfully unit tested, and
> * destined for the current or next Linux merge window.
>
> Basically, this should be just what you would send to Linus (or ask him
> to fetch). It is allowed to be rebased if you deem it necessary.
Please accept my apologies for my messing this up.
Valentin, may I apply your Signed-off-by? Otherwise, I am liable to
again get it into -next where it is not yet ready to go. But without it,
rcutorture gets noise from 12e08bc4d ("sched/hotplug: Consolidate task
migration on CPU unplug") that is otherwise difficult to diagnose. :-/
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 190 bytes --] Hi all, Commit 3e90d423e754 ("EXP net: phy: make mdio_bus_phy_suspend/resume as __maybe_unused") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Mon, Mar 08, 2021 at 05:03:27PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> 3e90d423e754 ("EXP net: phy: make mdio_bus_phy_suspend/resume as __maybe_unused")
>
> is missing a Signed-off-by from its committer.
Fixed, thank you and apologies!
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 325 bytes --] Hi all, Commits 5f47b19cd121 ("rcu: Do not disable gp stall detection in rcu_cpu_stall_reset()") 96100b1ecfd7 ("rcu/tree: Handle VM stoppage in stall detection") 399a8f91964e ("Documentation/RCU: Fix nested inline markup") are missing a Signed-off-by from their committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Sun, May 23, 2021 at 01:02:44PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Commits
>
> 5f47b19cd121 ("rcu: Do not disable gp stall detection in rcu_cpu_stall_reset()")
> 96100b1ecfd7 ("rcu/tree: Handle VM stoppage in stall detection")
> 399a8f91964e ("Documentation/RCU: Fix nested inline markup")
>
> are missing a Signed-off-by from their committer.
You would think that I could remember to add the "-s", wouldn't you?
Apologies for the hassle -- will fix on next rebase.
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 171 bytes --] Hi all, Commit 946ab1bbf6f0 ("rcu: Use a single ->barrier_lock for all CPUs") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Tue, Jan 04, 2022 at 08:38:17AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> 946ab1bbf6f0 ("rcu: Use a single ->barrier_lock for all CPUs")
>
> is missing a Signed-off-by from its committer.
Apologies, will fix on my next rebase.
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 221 bytes --] Hi all, Commit a3450c5ce1df ("Revert "rcu: Simplify rcu_init_nohz() cpumask handling"") is missing a Signed-off-by from its author and committer. Reverts are commits, too. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Thu, Sep 22, 2022 at 08:12:35PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> a3450c5ce1df ("Revert "rcu: Simplify rcu_init_nohz() cpumask handling"")
>
> is missing a Signed-off-by from its author and committer.
>
> Reverts are commits, too.
Apologies, missed a rebase to drop the revert and the original commit,
will fix!
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 236 bytes --] Hi all, Commit e4beed6287ce ("Revert "rcu/kvfree: Eliminate k[v]free_rcu() single argument macro"") is missing a Signed-off-by from its author and committer. Reverts are commits as well. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Wed, Mar 08, 2023 at 01:16:21PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Commit
>
> e4beed6287ce ("Revert "rcu/kvfree: Eliminate k[v]free_rcu() single argument macro"")
>
> is missing a Signed-off-by from its author and committer.
>
> Reverts are commits as well.
Apologies, and fixed. Hopefully, the infiniband guys get that commit
back into -next that would make this revert unnecessary...
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 565 bytes --] Hi all, Commits 1d29b558483d ("tools/nolibc: remove LINUX_REBOOT_ constants") 09efff85e556 ("tools/nolibc: add testcase for fork()/waitpid()") d9d16cc80854 ("tools/nolibc: s390: provide custom implementation for sys_fork") c792624d254d ("tools/nolibc: validate C89 compatibility") d7644912ea9c ("tools/nolibc: use C89 comment syntax") 9cd4e2eb852c ("tools/nolibc: use __inline__ syntax") 367742887f79 ("tools/nolibc: use standard __asm__ statements") are missing a Signed-off-by from their committer. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Wed, May 17, 2023 at 08:41:15AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Commits
>
> 1d29b558483d ("tools/nolibc: remove LINUX_REBOOT_ constants")
> 09efff85e556 ("tools/nolibc: add testcase for fork()/waitpid()")
> d9d16cc80854 ("tools/nolibc: s390: provide custom implementation for sys_fork")
> c792624d254d ("tools/nolibc: validate C89 compatibility")
> d7644912ea9c ("tools/nolibc: use C89 comment syntax")
> 9cd4e2eb852c ("tools/nolibc: use __inline__ syntax")
> 367742887f79 ("tools/nolibc: use standard __asm__ statements")
>
> are missing a Signed-off-by from their committer.
Apologies, thank you, and will fix!
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 350 bytes --] Hi all, In commit df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") Fixes tag Fixes: 8e3ab529bef9 ("tools/nolibc/unistd: add syscall()") has these problem(s): - Target SHA1 does not exist Maybe you meant Fixes: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #1: Type: text/plain, Size: 551 bytes --] Hi all, Sorry, the subject should have been "linux-next: fixes tag needs work in rcu tree". On Fri, 9 Jun 2023 08:27:22 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > In commit > > df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") > > Fixes tag > > Fixes: 8e3ab529bef9 ("tools/nolibc/unistd: add syscall()") > > has these problem(s): > > - Target SHA1 does not exist > > Maybe you meant > > Fixes: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #1: Type: text/plain, Size: 2995 bytes --] Hi all, bc6edad600e6 ("selftests/nolibc: make sure gcc always use little endian on MIPS") 15f57edf4753 ("selftests/nolibc: also count skipped and failed tests in output") 87c76b30c631 ("selftests/nolibc: add new gettimeofday test cases") 168bacf2b889 ("selftests/nolibc: remove gettimeofday_bad1/2 completely") b58a501ed987 ("selftests/nolibc: support two errnos with EXPECT_SYSER2()") 5b654b2c0284 ("tools/nolibc: open: fix up compile warning for arm") a50316875429 ("tools/nolibc: arm: add missing my_syscall6") 1993d9c770c2 ("selftests/nolibc: use INT_MAX instead of __INT_MAX__") fc41c241d79c ("selftests/nolibc: not include limits.h for nolibc") a8b20e76e877 ("selftests/nolibc: fix up compile warning with glibc on x86_64") d785d831bde5 ("selftests/nolibc: allow specify extra arguments for qemu") df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") 3f83dcdf4fc6 ("selftests/nolibc: remove test gettimeofday_null") a54457590ece ("tools/nolibc: ensure fast64 integer types have 64 bits") a232f7f31314 ("selftests/nolibc: test_fork: fix up duplicated print") c79ff8143435 ("tools/nolibc: ppoll/ppoll_time64: add a missing argument") b1f9a5df6b53 ("selftests/nolibc: remove the duplicated gettimeofday_bad2") b38d446d8364 ("selftests/nolibc: print name instead of number for EOVERFLOW") 37363156afc3 ("tools/nolibc: support nanoseconds in stat()") 6a1935f83840 ("selftests/nolibc: prevent coredumps during test execution") 6066aced432c ("tools/nolibc: add support for prctl()") 997c1685b7ec ("tools/nolibc: s390: disable stackprotector in _start") 4eb9ada569ee ("tools/nolibc: fix segfaults on compilers without attribute no_stack_protector") be5547775590 ("tools/nolibc: simplify stackprotector compiler flags") ea22ffdf3acf ("tools/nolibc: add autodetection for stackprotector support") 92b85d2cc2e4 ("tools/nolibc: reformat list of headers to be installed") af29d2e6df83 ("tools/nolibc: add test for __stack_chk_guard initialization") b0e9a86caded ("tools/nolibc: ensure stack protector guard is never zero") f14f35a85ee6 ("tools/nolibc: x86_64: disable stack protector for _start") 9d15cbe52c62 ("tools/nolibc: fix typo pint -> point") 340529052f74 ("tools/nolibc: riscv: add stackprotector support") 9b80e2f60acb ("tools/nolibc: mips: add stackprotector support") 58ac7b1823c7 ("tools/nolibc: loongarch: add stackprotector support") 3259f396c0e6 ("tools/nolibc: arm: add stackprotector support") 8411f6ee8393 ("tools/nolibc: aarch64: add stackprotector support") 8c9ea6b3d1b7 ("selftests/nolibc: reduce syscalls during space padding") 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") 5f97e9feb11e ("tools/nolibc: riscv: Fix up load/store instructions for rv32") are missing a Signed-off-by from their committer. It looks like you should have merged someone else's branch, but ended up rebasing it instead. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
Hi, Stephen, Willy, Thomas, Paul > Hi all, > > Sorry, the subject should have been "linux-next: fixes tag needs work > in rcu tree". > > On Fri, 9 Jun 2023 08:27:22 +1000 Stephen Rothwell <sfr@canb.auug.org.au> w= > rote: > > > > In commit > >=20 > > df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") > >=20 > > Fixes tag > >=20 > > Fixes: 8e3ab529bef9 ("tools/nolibc/unistd: add syscall()") > >=20 > > has these problem(s): > >=20 > > - Target SHA1 does not exist > >=20 > > Maybe you meant > >=20 > > Fixes: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") Thanks, just checked the rcu/next branch of Paul, the commit is really the one you corrected: Fixes: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") Willy, this happened may be because of the 'int' to 'long' fixup merged to the old "tools/nolibc/unistd: add syscall()" commit, I forgot the check of this change in my patch. Btw, perhaps it is possible to merge this typo fixup (tools/nolibc: fix up typo _sycall_narg -> _syscall_narg) [1] to this commit too: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") And then update the new 'Fixes' tag in this patch: df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") Or even merge both of them to the first one, and eventually, no Fixes lines required. As a summary, the following two fixes: df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") not merged ("tools/nolibc: fix up typo _sycall_narg -> _syscall_narg"), see [1] are for this one: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") Merging both of them to the above one may be a choice ;-) Best Regards, Zhangjin [1]: https://lore.kernel.org/lkml/64f663e9e024564a7baca6769394f1e7d5a0422c.1686230738.git.falcon@tinylab.org/
On Fri, Jun 09, 2023 at 12:08:04PM +0800, Zhangjin Wu wrote: > Hi, Stephen, Willy, Thomas, Paul > > > Hi all, > > > > Sorry, the subject should have been "linux-next: fixes tag needs work > > in rcu tree". > > > > On Fri, 9 Jun 2023 08:27:22 +1000 Stephen Rothwell <sfr@canb.auug.org.au> w= > > rote: > > > > > > In commit > > >=20 > > > df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") > > >=20 > > > Fixes tag > > >=20 > > > Fixes: 8e3ab529bef9 ("tools/nolibc/unistd: add syscall()") > > >=20 > > > has these problem(s): > > >=20 > > > - Target SHA1 does not exist > > >=20 > > > Maybe you meant > > >=20 > > > Fixes: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") > > Thanks, just checked the rcu/next branch of Paul, the commit is really the one > you corrected: > > Fixes: 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") > > Willy, this happened may be because of the 'int' to 'long' fixup merged to the > old "tools/nolibc/unistd: add syscall()" commit, I forgot the check of this > change in my patch. I was very careful about squashing the patches that mentioned commit IDs that were not merged yet (since we don't want to merge incomplete patches), but apparently missed this one :-/ > Btw, perhaps it is possible to merge this typo fixup (tools/nolibc: fix up typo > _sycall_narg -> _syscall_narg) [1] to this commit too: > > 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") > > And then update the new 'Fixes' tag in this patch: > > df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") > > Or even merge both of them to the first one, and eventually, no Fixes lines > required. > > As a summary, the following two fixes: > > df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx") > > not merged ("tools/nolibc: fix up typo _sycall_narg -> _syscall_narg"), see [1] > > are for this one: > > 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()") > > Merging both of them to the above one may be a choice ;-) Agreed. I'll see off-line with Paul how to best proceed. Thanks, Willy
On Fri, Jun 09, 2023 at 08:31:02AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> bc6edad600e6 ("selftests/nolibc: make sure gcc always use little endian on MIPS")
> 15f57edf4753 ("selftests/nolibc: also count skipped and failed tests in output")
> 87c76b30c631 ("selftests/nolibc: add new gettimeofday test cases")
> 168bacf2b889 ("selftests/nolibc: remove gettimeofday_bad1/2 completely")
> b58a501ed987 ("selftests/nolibc: support two errnos with EXPECT_SYSER2()")
> 5b654b2c0284 ("tools/nolibc: open: fix up compile warning for arm")
> a50316875429 ("tools/nolibc: arm: add missing my_syscall6")
> 1993d9c770c2 ("selftests/nolibc: use INT_MAX instead of __INT_MAX__")
> fc41c241d79c ("selftests/nolibc: not include limits.h for nolibc")
> a8b20e76e877 ("selftests/nolibc: fix up compile warning with glibc on x86_64")
> d785d831bde5 ("selftests/nolibc: allow specify extra arguments for qemu")
> df772c12508a ("selftests/nolibc: syscall_args: use generic __NR_statx")
> 3f83dcdf4fc6 ("selftests/nolibc: remove test gettimeofday_null")
> a54457590ece ("tools/nolibc: ensure fast64 integer types have 64 bits")
> a232f7f31314 ("selftests/nolibc: test_fork: fix up duplicated print")
> c79ff8143435 ("tools/nolibc: ppoll/ppoll_time64: add a missing argument")
> b1f9a5df6b53 ("selftests/nolibc: remove the duplicated gettimeofday_bad2")
> b38d446d8364 ("selftests/nolibc: print name instead of number for EOVERFLOW")
> 37363156afc3 ("tools/nolibc: support nanoseconds in stat()")
> 6a1935f83840 ("selftests/nolibc: prevent coredumps during test execution")
> 6066aced432c ("tools/nolibc: add support for prctl()")
> 997c1685b7ec ("tools/nolibc: s390: disable stackprotector in _start")
> 4eb9ada569ee ("tools/nolibc: fix segfaults on compilers without attribute no_stack_protector")
> be5547775590 ("tools/nolibc: simplify stackprotector compiler flags")
> ea22ffdf3acf ("tools/nolibc: add autodetection for stackprotector support")
> 92b85d2cc2e4 ("tools/nolibc: reformat list of headers to be installed")
> af29d2e6df83 ("tools/nolibc: add test for __stack_chk_guard initialization")
> b0e9a86caded ("tools/nolibc: ensure stack protector guard is never zero")
> f14f35a85ee6 ("tools/nolibc: x86_64: disable stack protector for _start")
> 9d15cbe52c62 ("tools/nolibc: fix typo pint -> point")
> 340529052f74 ("tools/nolibc: riscv: add stackprotector support")
> 9b80e2f60acb ("tools/nolibc: mips: add stackprotector support")
> 58ac7b1823c7 ("tools/nolibc: loongarch: add stackprotector support")
> 3259f396c0e6 ("tools/nolibc: arm: add stackprotector support")
> 8411f6ee8393 ("tools/nolibc: aarch64: add stackprotector support")
> 8c9ea6b3d1b7 ("selftests/nolibc: reduce syscalls during space padding")
> 6bff2a1e97e3 ("tools/nolibc/unistd: add syscall()")
> 5f97e9feb11e ("tools/nolibc: riscv: Fix up load/store instructions for rv32")
>
> are missing a Signed-off-by from their committer.
>
> It looks like you should have merged someone else's branch, but ended
> up rebasing it instead.
We will be moving to me pulling directly from Willy's tree, but that will
be next cycle. Me, I stupidly forgot the "-s" argument. Apologies for
the hassle, and fixed.
Thanx, Paul
[-- Attachment #1: Type: text/plain, Size: 314 bytes --] Hi all, Commits cae00f2ab011 ("Revert "hrtimer: Report offline hrtimer enqueue"") 9addc18fe8cd ("Revert "rcu-tasks: Eliminate deadlocks involving do_exit() and RCU tasks"") are missing a Signed-off-by from their author and commiter. Reverts are commits as well. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
On Thu, Feb 08, 2024 at 07:39:19AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Commits
>
> cae00f2ab011 ("Revert "hrtimer: Report offline hrtimer enqueue"")
> 9addc18fe8cd ("Revert "rcu-tasks: Eliminate deadlocks involving do_exit() and RCU tasks"")
>
> are missing a Signed-off-by from their author and commiter.
>
> Reverts are commits as well.
Apologies, will fix!
Thanx, Paul