All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: "Patrick Mullaney" <pmullaney@novell.com>
Cc: "Gregory Haskins" <GHaskins@novell.com>, <davem@davemloft.net>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH] net/core/sock.c remove extra wakeup
Date: Sun, 01 Jun 2008 23:03:41 +0200	[thread overview]
Message-ID: <87prr027gy.fsf@basil.nowhere.org> (raw)
In-Reply-To: <483FDE61020000C7000389F6@lucius.provo.novell.com> (Patrick Mullaney's message of "Fri, 30 May 2008 11:00:49 -0600")

"Patrick Mullaney" <pmullaney@novell.com> writes:
>
> Would a better approach be?
>
> 1) clear the bit when the waiter returns(bottom of sock_wait_for_wmem)
> 2) add a new wait-queue to the socket to separate the writers
> 3) another idea?

A large reason this is tricky is because it is essentially lockless. So
alternative would be:

4) you add a spinlock which is always taken around the various condition
checks and bit manipulation. Not 100% sure if it would be bad to 
general SMP scalability (you would need to ensure that the bouncing
lock cache line isn't a performance problem), but at least it would 
be much safer and makes it much easier to verify your change is correct.

Actually the wait queue already has such a lock, so it might not be
that expensive if you switch the wait queue to a lockless version.

-Andi


  reply	other threads:[~2008-06-01 21:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <483F99090200005A00037FFE@lucius.provo.novell.com>
     [not found] ` <483F990C0200005A00038001@lucius.provo.novell.com>
2008-05-30 17:00   ` [PATCH] net/core/sock.c remove extra wakeup Patrick Mullaney
2008-06-01 21:03     ` Andi Kleen [this message]
     [not found] <483F99090200005A00037FFE@sinclair.provo.novell.com>
2008-05-30 10:05 ` Gregory Haskins
2008-06-11  6:46   ` Herbert Xu
2008-06-16  3:48     ` Gregory Haskins
2008-05-29 16:08 Patrick Mullaney
2008-05-30  9:52 ` David Miller

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=87prr027gy.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=GHaskins@novell.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pmullaney@novell.com \
    /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.