On Mon, Oct 16, 2023 at 10:17:50PM +0300, Vitaliy Makkoveev wrote: > This socket comes from userland, so this flag is never set. This makes > SB_NOINTR flag immutable, because we only set this bit on NFS client > socket buffers for all it's lifetime. > > I want to do this because this flag modifies sblock() behaviour and it's > not clean which lock should protect it for standalone sblock(). > > ok?
This code came here: https://svnweb.freebsd.org/csrg/sys/nfs/nfs_syscalls.c?revision=41903&view=markup "update from Rick Macklem adding TCP support to NFS" I would guess that this flag must be cleared to allow to kill the NFS server if a client does not respond. Otherwise it may hang in sbwait() in soreceive() or sosend(). As the flags are never set, your diff does not change behavior. > I want to completely remove SB_NOINTR flag. Only NFS client sets it, but > since the socket never passed to userland, this flag is useless, because > we can't send singnal to kernel thread. So for this sblock()/sbwait() > sleep is uninterruptible. But I want to not mix NFS server and NFS > client diffs. The NFS client does not run as kernel thread, but as the process that does file system access. You can Ctrl-C it if mount uses "intr" option. NFSMNT_INT sets some PCATCH and sb_timeo_nsecs, but I think signal should also abort sbwait(). That is why NFS client sets SB_NOINTR. As this flag is only set during mount or reconnect. It is a problem for MP? Is it modified in a non-initialization path? bluhm > Index: sys/nfs/nfs_syscalls.c > =================================================================== > RCS file: /cvs/src/sys/nfs/nfs_syscalls.c,v > retrieving revision 1.119 > diff -u -p -r1.119 nfs_syscalls.c > --- sys/nfs/nfs_syscalls.c 3 Aug 2023 09:49:09 -0000 1.119 > +++ sys/nfs/nfs_syscalls.c 16 Oct 2023 19:00:02 -0000 > @@ -276,9 +276,7 @@ nfssvc_addsock(struct file *fp, struct m > m_freem(m); > } > solock(so); > - so->so_rcv.sb_flags &= ~SB_NOINTR; > so->so_rcv.sb_timeo_nsecs = INFSLP; > - so->so_snd.sb_flags &= ~SB_NOINTR; > so->so_snd.sb_timeo_nsecs = INFSLP; > sounlock(so); > if (tslp)