lkml.org 
[lkml]   [2021]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V2 3/3] signal: Allow tasks to cache one sigqueue struct
On 03/11, Thomas Gleixner wrote:
>
> @@ -456,7 +460,12 @@ static void __sigqueue_free(struct sigqu
> return;
> if (atomic_dec_and_test(&q->user->sigpending))
> free_uid(q->user);
> - kmem_cache_free(sigqueue_cachep, q);
> +
> + /* Cache one sigqueue per task */
> + if (!current->sigqueue_cache)
> + current->sigqueue_cache = q;
> + else
> + kmem_cache_free(sigqueue_cachep, q);
> }

This doesn't look right, note that __exit_signal() does
flush_sigqueue(&sig->shared_pending) at the end, after exit_task_sighand()
was already called.

I'd suggest to not add the new exit_task_sighand() helper and simply free
current->sigqueue_cache at the end of __exit_signal().

Oleg.

\
 
 \ /
  Last update: 2021-03-12 17:14    [W:0.167 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site