All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jim Rees <rees@umich.edu>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] rpc.gssd: don't call poll() twice a second
Date: Tue, 31 Jul 2012 12:50:42 -0400	[thread overview]
Message-ID: <50180CE2.3040300@RedHat.com> (raw)
In-Reply-To: <20120730221039.GB21730@fieldses.org>



On 07/30/2012 06:10 PM, J. Bruce Fields wrote:
> On Mon, Jul 30, 2012 at 04:59:49PM -0400, J. Bruce Fields wrote:
>> On Sun, Jul 29, 2012 at 07:09:30PM -0400, Steve Dickson wrote:
>>>
>>>
>>> On 07/29/2012 01:48 PM, J. Bruce Fields wrote:
>>>> On Fri, Jul 27, 2012 at 07:08:53PM -0400, Jim Rees wrote:
>>>>> J. Bruce Fields wrote:
>>>>>
>>>>>   +	if (1 != write(pipefd[1], "!", 1))
>>>>>   +		printerr(2, "weird; maybe an interrupt?");
>>>>>
>>>>> Use Yoda conditions must we?
>>>>
>>>> Yeah, yeah.  How about:
>>>>
>>>> 	 static void something_changed(void)
>>>> 	 {
>>>> 	-	if (1 != write(pipefd[1], "!", 1))
>>>> 	-		printerr(2, "weird; maybe an interrupt?");
>>>> 	+	if (write(pipefd[1], "!", 1) != 1)
>>>> 	+		printerr(0, "%s writing to pipe", strerror(errno));
>>>> 	 }
>>>>  
>>>> ?
>>> Better... IMHO..  but what's going to mean when we see that in some log?
>>
>> Beats me.
> 
> Looking at it a little more: actually, if gssd is slow to process these
> events then in theory they could pile up, and we could eventually get
> EAGAIN/WOUDBLOCK.
> 
> Which wouldn't be a problem, except that now we're modifying errno in a
> signal handler.  So the signal handler should be saving and restoring
> errno.
> 
> And also: I noticed one of the reasons gssd hasn't been completely
> reliable for me is that we already have a printerr() in the signal
> handler, and printerr() doesn't appear to be reentrant.
> 
> Eh, I'm leaning toward just using ppoll.  According to the man page that
> requires kernel >= 2.6.16, glibc >= 2.4.  Is that OK?
I would think so.... 

steved.


  reply	other threads:[~2012-07-31 18:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 21:02 [PATCH] rpc.gssd: don't call poll() twice a second J. Bruce Fields
2012-07-27 23:08 ` Jim Rees
2012-07-29 17:48   ` J. Bruce Fields
2012-07-29 23:09     ` Steve Dickson
2012-07-30 20:59       ` J. Bruce Fields
2012-07-30 22:10         ` J. Bruce Fields
2012-07-31 16:50           ` Steve Dickson [this message]
2012-07-31 20:59             ` J. Bruce Fields
2012-07-31 21:00               ` [PATCH 1/4] rpc.gssd: simplify signal handling J. Bruce Fields
2012-08-06 14:22                 ` Steve Dickson
2012-07-31 21:00               ` [PATCH 2/4] rpc.gssd: don't call printerr from signal handler J. Bruce Fields
2012-07-31 21:22                 ` Chuck Lever
2012-08-06 14:22                 ` Steve Dickson
2012-07-31 21:00               ` [PATCH 3/4] rpc.gssd: handle error to open toplevel directory J. Bruce Fields
2012-08-06 14:23                 ` Steve Dickson
2012-07-31 21:00               ` [PATCH 4/4] rpc.gssd: don't call poll() twice a second J. Bruce Fields
2012-07-31 21:23                 ` Chuck Lever
2012-07-31 21:27                   ` J. Bruce Fields
2012-07-31 22:29                     ` Chuck Lever
2012-08-01 12:35                       ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50180CE2.3040300@RedHat.com \
    --to=steved@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rees@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.