Re: ucom console again [PATCH]

Emmanuel Dreyfus <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Sun, Dec 21, 2025 at 09:05:19AM +0000, Nick Hudson wrote:
> I've already told you where the problem is "cn_sending is racey and it's my
> fault."
> 
> Something like making ucom_cnput_bytes  loop and right after it does
> 
>             atomic_store_relaxed(&cn->cn_sending, 0);
> 
> it should re-check the ring for entries and try to set it again, etc...

If I understand you correcty, the problem is a race here (atomic
functions removed for the sake of clarity):

if (cn->cn_prod_out - cn->cn_cons_out == 0) {
	/* cn->cn_prod_out is increased between the test and set */
	cn->cn_sending = 0. 
}

Did I get you right?


-- 
Emmanuel Dreyfus
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.