All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 6/6] sched, wait: Make the __wait_event*() interface more friendly
@ 2013-10-01  8:00 Julian Anastasov
  2013-10-01 17:19 ` Oleg Nesterov
  0 siblings, 1 reply; 6+ messages in thread
From: Julian Anastasov @ 2013-10-01  8:00 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Oleg Nesterov, Paul McKenney, Linus Torvalds,
	Thomas Gleixner, Andrew Morton, netfilter-devel, pablo


	Hello,

> On Fri, Sep 27, 2013 at 06:15:07PM +0200, Peter Zijlstra wrote:
> > +++ b/net/netfilter/ipvs/ip_vs_sync.c
> > @@ -1637,12 +1637,9 @@ static int sync_thread_master(void *data
> >                     continue;
> >             }
> >             while (ip_vs_send_sync_msg(tinfo->sock, sb->mesg) < 0) {
> > -                   int ret = 0;
> > -
> > -                   __wait_event_interruptible(*sk_sleep(sk),
> > +                   int ret = 
__wait_event_interruptible(*sk_sleep(sk),
> >                                                sock_writeable(sk) ||
> > -                                              kthread_should_stop(),
> > -                                              ret);
> > +                                              kthread_should_stop());
> >                     if (unlikely(kthread_should_stop()))
> >                             goto done;
> >             }
>
> That site seems to be ignoring the interruptible state... seems wrong.

	This is a kthread which ignores signals by default.
It terminates only with kthread_stop. I hope it works
correctly for such context. This is a loop that polls socket
space for writing when there is a buffer for sending.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 0/6] sched, wait: Collapse __wait_event macros -v4
@ 2013-09-30 15:22 Peter Zijlstra
  2013-09-30 15:22 ` [PATCH 6/6] sched, wait: Make the __wait_event*() interface more friendly Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2013-09-30 15:22 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Oleg Nesterov, Paul McKenney, Linus Torvalds, Thomas Gleixner,
	Andrew Morton, linux-kernel, Peter Zijlstra

While poking at the cpu hotplug implementation I had a desire to use
wait_event() with schedule_preempt_disabled() and found the rediculous
amount of duplication in linux/wait.h.

These patches attempt to cure some of this while also making it
'trivial' to generate new variants.

Compile and boot tested on x86_64.

Changes since -v3:
 - added LKML to the CC (D'0h!!)
 - introduced ___wait_cond_timeout() to avoid double evalutation of 'condition'

Changes since -v2:
 - removed ___wait_cmd_lock_irq(), ___wait_cmd_lock_irq_timo()
 - renamed ___wait_cmd_test_timeout() to ___wait_test_timeout()
 - renamed ___wait_cmd_schedule_timeout() to ___wait_sched_timeout()
 - fixed schedule_timeout() invocations in patch 6; don't restart a
   schedule_timeout() at the total timeout; rather continue where we
   left off for a total fixed timeout.
 - use 'long' return type for ___wait_event() so that timeout values
   for schedule_timeout() fit.
 - fix wait_event_interruptible_lock_irq_timeout() and use long return type.


---
 arch/mips/kernel/rtlx.c         |   19 +-
 include/linux/tty.h             |   28 +---
 include/linux/wait.h            |  268 +++++++++++++---------------------------
 net/irda/af_irda.c              |    5 
 net/netfilter/ipvs/ip_vs_sync.c |    7 -
 5 files changed, 108 insertions(+), 219 deletions(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <20130927161501.323694767@infradead.org>]

end of thread, other threads:[~2013-10-01 19:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01  8:00 [PATCH 6/6] sched, wait: Make the __wait_event*() interface more friendly Julian Anastasov
2013-10-01 17:19 ` Oleg Nesterov
2013-10-01 19:58   ` Julian Anastasov
  -- strict thread matches above, loose matches on Subject: below --
2013-09-30 15:22 [PATCH 0/6] sched, wait: Collapse __wait_event macros -v4 Peter Zijlstra
2013-09-30 15:22 ` [PATCH 6/6] sched, wait: Make the __wait_event*() interface more friendly Peter Zijlstra
2013-10-01  6:39   ` Ingo Molnar
     [not found] <20130927161501.323694767@infradead.org>
     [not found] ` <20130927161852.137894317@infradead.org>
2013-09-27 17:08   ` Peter Zijlstra

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.