lkml.org 
[lkml]   [2004]   [Oct]   [17]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch rfc] towards supporting O_NONBLOCK on regular files
FromAlexandre Oliva <>
Date17 Oct 2004 04:59:51 -0300
On Oct 15, 2004, Jeff Moyer <jmoyer@redhat.com> wrote:

jmoyer> Yes, that sounds like a fine idea.  Here is a patch which does
jmoyer> this.  Andrew, I know you only want bug fixes, but I'd like to get
jmoyer> this into your queue for post 2.6.9, if possible.

> I got the partial read case wrong in the last patch.  In fact, it looks
> like this code path would perform infinite retries before.  This should
> address that by returning upon the first partial read.  Attached is a new
> version of the patch.

Don't you have to adjust poll/select as well, to test whether read has
any data to return immediately?  Squid is broken with the latest
FCdevel kernel, and this patch is in it.

The reason Squid breaks is that poll (or is it select? I forget) says
there's data to be read from cache files (as well as from error
message files read during start up), but then read fails with -EAGAIN.
If I bring the error files into memory with cat
/etc/squid/errors/ERR*, then squid will successfully start up, and
then, in order for it to not eat all the available CPU polling data
files and attempting to read from them, I need to start a command line
this:

pid=`pidof '(squid)'
while :; do
  lsof -p $pid |
  sed -n 's,.*\(/var/spool/squid/.*/.*/.*\),\1,p' |
  xargs cat /dev/null > /dev/null;
  sleep 5
done
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:07    [from the cache]
©2003-2008