All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Geert Uytterhoeven
	<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Cc: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH/RFC] signal: Export signal_wake_up_state() to modules
Date: Sat, 6 May 2017 21:42:56 +0200	[thread overview]
Message-ID: <20170506194256.GA21726@redhat.com> (raw)
In-Reply-To: <1493977751-19340-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>

On 05/05, Geert Uytterhoeven wrote:
>
> I'm using signal_wake_up() to abort a task blocked on
> wait_for_completion_interruptible(), cfr. sh_msiof_slave_abort() in
> "spi: sh-msiof: Add slave mode support"
> (http://www.spinics.net/lists/devicetree/msg175575.html).
>
> Is exporting signal_wake_up_state() an acceptable solution?
> Alternatively, I can extract the code to abort an completion into a
> generic abort_completion() function, and export that.

I too do not think this is a good idea... signal_wake_up() or even
set_tsk_thread_flag() should never be used unless you actually send a
signal. Yes, freeze_task() does this too but note that recalc_sigpending()
checks freezing() and in this case we really want the target to enter the
get_signal() path.

And in fact I do not really understand why do you need it, it seems that
you can easily rework this code and avoid this hack.

Not to mention that sh_msiof_slave_abort() plays with struct completion
internals, this doesn't look good too.

Finally, clear_thread_flag(TIF_SIGPENDING) in sh_msiof_wait_for_completion()
looks wrong. Or it is only for kthreads?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH/RFC] signal: Export signal_wake_up_state() to modules
Date: Sat, 6 May 2017 21:42:56 +0200	[thread overview]
Message-ID: <20170506194256.GA21726@redhat.com> (raw)
In-Reply-To: <1493977751-19340-1-git-send-email-geert+renesas@glider.be>

On 05/05, Geert Uytterhoeven wrote:
>
> I'm using signal_wake_up() to abort a task blocked on
> wait_for_completion_interruptible(), cfr. sh_msiof_slave_abort() in
> "spi: sh-msiof: Add slave mode support"
> (http://www.spinics.net/lists/devicetree/msg175575.html).
>
> Is exporting signal_wake_up_state() an acceptable solution?
> Alternatively, I can extract the code to abort an completion into a
> generic abort_completion() function, and export that.

I too do not think this is a good idea... signal_wake_up() or even
set_tsk_thread_flag() should never be used unless you actually send a
signal. Yes, freeze_task() does this too but note that recalc_sigpending()
checks freezing() and in this case we really want the target to enter the
get_signal() path.

And in fact I do not really understand why do you need it, it seems that
you can easily rework this code and avoid this hack.

Not to mention that sh_msiof_slave_abort() plays with struct completion
internals, this doesn't look good too.

Finally, clear_thread_flag(TIF_SIGPENDING) in sh_msiof_wait_for_completion()
looks wrong. Or it is only for kthreads?

Oleg.

  parent reply	other threads:[~2017-05-06 19:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  9:49 [PATCH/RFC] signal: Export signal_wake_up_state() to modules Geert Uytterhoeven
2017-05-05  9:49 ` Geert Uytterhoeven
     [not found] ` <1493977751-19340-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2017-05-05 10:07   ` Christoph Hellwig
2017-05-05 10:07     ` Christoph Hellwig
     [not found]     ` <20170505100729.GA21589-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-05-05 10:13       ` Geert Uytterhoeven
2017-05-05 10:13         ` Geert Uytterhoeven
2017-05-05 11:08         ` Geert Uytterhoeven
     [not found]           ` <CAMuHMdVUymKQzt9Rk1mgXxJdVD1O8yFQ6CxFAZDiLRDM795-Ew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-05 11:22             ` Christoph Hellwig
2017-05-05 11:22               ` Christoph Hellwig
2017-05-05 11:35               ` Geert Uytterhoeven
2017-05-06 19:42   ` Oleg Nesterov [this message]
2017-05-06 19:42     ` Oleg Nesterov
     [not found]     ` <20170506194256.GA21726-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-05-07  9:47       ` Geert Uytterhoeven
2017-05-07  9:47         ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170506194256.GA21726@redhat.com \
    --to=oleg-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.