Re: [PATCH] sctp: Do not wake readers in __sctp_write_space()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 13, 2025 at 5:45 PM Xin Long <lucien.xin@xxxxxxxxx> wrote:
>
> On Mon, May 12, 2025 at 8:33 AM Petr Malat <oss@xxxxxxxxx> wrote:
> >
> > Function __sctp_write_space() doesn't set poll key, which leads to
> > ep_poll_callback() waking up all waiters, not only these waiting
> > for the socket being writable. Set the key properly using
> > wake_up_interruptible_poll(), which is preferred over the sync
> > variant, as writers are not woken up before at least half of the
> > queue is available. Also, TCP does the same.
> >
> > Signed-off-by: Petr Malat <oss@xxxxxxxxx>
> > ---
> >  net/sctp/socket.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> > index 53725ee7ba06..b301d64d9d80 100644
> > --- a/net/sctp/socket.c
> > +++ b/net/sctp/socket.c
> > @@ -9100,7 +9100,8 @@ static void __sctp_write_space(struct sctp_association *asoc)
> >                 wq = rcu_dereference(sk->sk_wq);
> >                 if (wq) {
> >                         if (waitqueue_active(&wq->wait))
> > -                               wake_up_interruptible(&wq->wait);
> > +                               wake_up_interruptible_poll(&wq->wait, EPOLLOUT |
> > +                                               EPOLLWRNORM | EPOLLWRBAND);
> >
> >                         /* Note that we try to include the Async I/O support
> >                          * here by modeling from the current TCP/UDP code.
> > --
> > 2.39.5
> >
> Acked-by: Xin Long <lucien.xin@xxxxxxxxx>

Please re-send the patch and add:  netdev@xxxxxxxxxxxxxxx to the CC list.





[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     SCTP

  Powered by Linux