netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [IPV4] ROUTE: Avoid sparse warnings
Date: Tue, 8 Jan 2008 13:59:02 +0100	[thread overview]
Message-ID: <20080108125902.GB1920@ff.dom.local> (raw)
In-Reply-To: <47832BE6.5070906@cosmosbay.com>

On 08-01-2008 08:53, Eric Dumazet wrote:
> David Miller a écrit :
...
>> Furthermore, these:
>>
>>     rcu_read_unlock_bh()
>>     rcu_read_lock_bh()
>>
>> sequences are at best funny looking.  For other lock types we would
>> look at this and ask "Does this even accomplish anything reliably?"
> 
> Well, original code exactly does the same thing.
> 
>>
>> The answer here is that it wants the preempt_enable() to run to get
>> any potential kernel preemptions executed.  It also allows any
>> pending software interrupts to run.
>>
>> So this does something reliably only because rcu_read_unlock_bh() has
>> specific and explicit side effects.
>>
> 
> I will post a patch to introduce a helper function, so that this is 
> clearly documented and not relying on side effects. Actual 
> implementation has latency
> problems on empty hash tables if CONFIG_PREEMPT=n
> 
> 
>> I don't know, to me it just looks awful :-)  I better understood the
>> original code.

It seems this patch only made it more visible how it currently works.
I don't know what changes do you plan for this helper function, but
my proposal is to add some counter and break this rcu only after
looping for some time. Alternatively cpu_relax() could be probably
used between these "locks". Without this probably some cache problems
are possible, but you know this better, I guess.

Regards,
Jarek P.

      parent reply	other threads:[~2008-01-08 12:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 11:01 [IPV4] ROUTE: Avoid sparse warnings Eric Dumazet
2008-01-07 12:11 ` Herbert Xu
2008-01-07 13:56   ` Eric Dumazet
2008-01-07 20:38     ` Herbert Xu
2008-01-07 20:46       ` Eric Dumazet
2008-01-07 20:48         ` Herbert Xu
2008-01-08  6:54 ` David Miller
2008-01-08  7:53   ` Eric Dumazet
2008-01-08  9:34     ` David Miller
2008-01-08 12:59     ` Jarek Poplawski [this message]

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=20080108125902.GB1920@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).