Date: Wed, 25 Nov 2020 13:54:10 -0800 From: John Baldwin <jhb@FreeBSD.org> To: Mateusz Guzik <mjg@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r368038 - head/sys/kern Message-ID: <f7132603-d9b3-d671-f98c-1a325d3cee7c@FreeBSD.org> In-Reply-To: <202011252141.0APLfO8H072858@repo.freebsd.org> References: <202011252141.0APLfO8H072858@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11/25/20 1:41 PM, Mateusz Guzik wrote: > Author: mjg > Date: Wed Nov 25 21:41:23 2020 > New Revision: 368038 > URL: https://svnweb.freebsd.org/changeset/base/368038 > > Log: > pipe: drop spurious pipeunlock/pipelock cycle on write > > Modified: > head/sys/kern/sys_pipe.c > > Modified: head/sys/kern/sys_pipe.c > ============================================================================== > --- head/sys/kern/sys_pipe.c Wed Nov 25 21:25:17 2020 (r368037) > +++ head/sys/kern/sys_pipe.c Wed Nov 25 21:41:23 2020 (r368038) > @@ -997,10 +993,9 @@ retry: > pipeunlock(wpipe); > error = msleep(wpipe, PIPE_MTX(wpipe), > PRIBIO | PCATCH, "pipdww", 0); > + pipelock(wpipe, 0); > if (error) > goto error1; > - else > - goto retry; > } Hmm, what ensures that PIPE_EOF and PIPE_DIRECTW aren't still set once awakened that would permit removing the 'goto retry'? The goto is still present in the other case in this function, it was only removed from this one? > @@ -1282,12 +1270,13 @@ pipe_write(struct file *fp, struct uio *uio, struct uc > pipeunlock(wpipe); > error = msleep(wpipe, PIPE_MTX(rpipe), > PRIBIO | PCATCH, "pipewr", 0); > + pipelock(wpipe, 0); > if (error != 0) > break; > + continue; A continue as the last line of a while() loop seems spurious? -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f7132603-d9b3-d671-f98c-1a325d3cee7c>