Date: Wed, 27 Nov 2024 16:33:42 +0100 From: Christos Margiolis <christos@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5317480967bf - main - sound: Remove CHN_F_SLEEPING Message-ID: <74asrrtyd2ikapohanal6rqseac734wk4v4k4ifyrzqrt7jpff@xnvv5amia64w> In-Reply-To: <4234bd4a-29a0-4f95-bebb-d745c101cd25@FreeBSD.org> References: <202411261448.4AQEmw7Y084208@gitrepo.freebsd.org> <77c4113c-c023-4db3-826a-83be4e9baa42@FreeBSD.org> <vvqbxb25dikutghe4pknggpu2mely3syk44sfbk4zpweymzvuz@pia6d26v6a2t> <4234bd4a-29a0-4f95-bebb-d745c101cd25@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote: > On 11/26/24 12:17, Christos Margiolis wrote: > > John Baldwin wrote: > > > On 11/26/24 06:48, Christos Margiolis wrote: > > > > The branch main has been updated by christos: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=5317480967bfc8bf678e4da3fce81bcb3f5b7836 > > > > [...] > > > > "\004TRIGGERED" \ > > > > + /* \006 */ \ > > > > "\005NOTRIGGER" \ > > > > - "\006SLEEPING" \ > > > > "\007NBIO" \ > > > > > > Hmm, new comment is mis-sorted? > > > > Yes. Oops. > > > > > > [...] > > > > + if (ch->intr_cv.cv_waiters == 0 && CHN_STOPPED(ch) && > > > > + ch->inprog == 0) { > > > > > > I'm not super excited about reading cv_waiters directly. Generally speaking > > > 'struct cv' is opaque to the rest of the kernel. Maybe add a little inline > > > routine or macro cv_waiters() that returns this value instead? Then it can > > > be documented in condvar.9 along with the caveats about when it is safe to > > > use. > > > > I see we already have cv_wmesg() in sys/sys/condvar.h to access > > cv_description. Maybe we could add a cv_waiters() macro in there as > > well? > > Yes, that is where I would add it. https://reviews.freebsd.org/D47779 https://reviews.freebsd.org/D47780 Christos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?74asrrtyd2ikapohanal6rqseac734wk4v4k4ifyrzqrt7jpff>