On Wed, Mar 27, 2024 at 11:35:01PM +0100, Alexander Bluhm wrote:
> On Thu, Mar 28, 2024 at 01:21:17AM +0300, Vitaliy Makkoveev wrote:
> > On Wed, Mar 27, 2024 at 10:51:09PM +0100, Alexander Bluhm wrote:
> > > On Wed, Mar 27, 2024 at 10:26:27PM +0300, Vitaliy Makkoveev wrote:
> > > > On Wed, Mar 27, 2024 at 08:17:33AM +0100, Anton Lindqvist wrote:
> > > > > 
> > > > > Observing two regress hangs in the kernel on netio. Both seems make 
> > > > > use
> > > > > of unix sockets. Could this be the culprit?
> > > > > 
> > > > > regress/lib/libc/fread
> > > > > regress/usr.bin/ssh (scp.sh)
> > > > 
> > > > Sorry for delay.
> > > > 
> > > > It was exposed that `sb_mtx' should not be released between `so_rcv'
> > > > usage check and corresponding sbwait() sleep. Otherwise wakeup() could
> > > > be lost sometimes.
> > > > 
> > > > This diff fixed regress tests. It introduces sbunlock_locked() and
> > > > sbwait_locked() to perform with `sb_mtx' held.
> > > 
> > > Do we really need a restart_unlocked label?
> > > Instead of goto restart_unlocked you could call solock_shared(so)
> > > and fall through goto restart;
> > > 
> > 
> > This was the first version, but later I decided 'restart_unlocked' is
> > better. No problems to return it back.
> > 
> > > I don't like pr_protocol == AF_UNIX check in generic soreceive()
> > > function.  Could we check SB_MTXLOCK instead?
> > > 
> > 
> > Me too. I used "pr_protocol == AF_UNIX" check because sosend() does the
> > same. The existing SB_MTXLOCK used by some inet sockets and I strictly
> > want to move them separately of this fix.
> > 
> > I propose to introduce SB_OWNLOCK flag and check it. I wanted to use
> > this flag for socket with standalone sblock() ability to modify
> > sblock()/sbwait() behaviour. I need this flag to convert all
> > SB_MTXLOCK'ed sockets separately. After conversion, both SB_MTXLOCK and
> > SB_OWNLOCK will be removed.
> > 
> > I propose to introduce SB_OWNLOCK right now and use it instead of
> > "pr_protocol == AF_UNIX" check to keep inet sockets as is. I have no
> > objections to convert them too, but separately.
> 
> sb_flags is short, can you use 4 digits 0x0000 for the flags?
> And please use a space after #define, then the diff is less ugly.
> 

Done. Thanks.

Reply via email to