Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Sep 2005 09:43:41 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_poll.c
Message-ID:  <20050905094341.A23343@xorpc.icir.org>
In-Reply-To: <200509051602.j85G2Bpo090258@repoman.freebsd.org>; from glebius@FreeBSD.org on Mon, Sep 05, 2005 at 04:02:11PM %2B0000
References:  <200509051602.j85G2Bpo090258@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
gleb, could you document how you are using the PRF_RUNNING
and PRF_LEAVING flags that you added ?

also i am unclear on whether there is a race condition involving
unregistering poll (second part of netisr_poll())
while running the section of ether_poll() where it drops
the mutex before calling the handler.

ether_poll signals its activity with PRF_RUNNING, but
netisr_poll() does not check it, so it might happen that

	1. on one CPU, ether_poll() drops the lock before calling
		pr[i].handler(), perhaps even getting descheduled

	2. on another CPU, netisr_poll() gets the lock and goes
	   all the way to the end, setting pr[i].handler = NULL

	3. on the first CPU, without further checks, the code
	   tries to dereference the field.

Also, what is the overall design - do you want to support multiple polling
loops running concurrently (netisr_poll, one poll_idle per CPU,
and possibly the poll_in_trap) ?

	cheers
	luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050905094341.A23343>