mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: "Wang, Yalin" <Yalin.Wang@sonymobile.com>
Cc: "'linux-arm-msm-owner@vger.kernel.org'" 
	<linux-arm-msm-owner@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Peng, Arthur" <Arthur.Peng@sonymobile.com>,
	"Zhang, Bojie" <Bojie.Zhang@sonymobile.com>,
	"Gu, Youcai 1 (EXT)" <Youcai1.Gu@sonymobile.com>,
	"Alevoor, Raghavendra 2" <Raghavendra.Alevoor@sonymobile.com>
Subject: Re: BUG report about ipt_do_table( )
Date: Fri, 11 Oct 2013 12:02:47 +0100	[thread overview]
Message-ID: <20131011110247.GF14732@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <35FD53F367049845BC99AC72306C23D1014D1A0971B6@CNBJMBX05.corpusers.net>

On Fri, Oct 11, 2013 at 02:50:24AM +0100, Wang, Yalin wrote:
> Hi  Will,

Hello again,

> Maybe I know your meaning ,
> If it use spinlock to protected the shared data,
> The bug will not happen, because spinlock will 
> Use DSB( )  to sync .

Actually, the dsb is for something else (the sev). It is the smp_mb() call
which guarantees the ordering of critical sections with respect to spinlock
operations.

> Unluckily, here, it use a special seqcount_t( ) (see get_counters( ) function)

Well, there is a comment about a write_lock being held, so you should be ok
if that's true. The issue I saw was with the newinfo population, as I
described in my earlier mail.

> To make sure there is no others using the old data,
> Before release the old data, this is much like RCU
> Work, but RCU use rcu_assign_pointer( ) -->
> Which use smp_wmb( ) , so it's safe,  am I right ?

RCU is safe. There are *many* weakly ordered architectures on which Linux
runs, so I don't think you have to worry too much about the core data
structures and locking/synchronisation/atomic primitives. The major scope
for errors is in lockless code, where the barrier usage is explicit.

> In my patch, I use mb( ), because this macro
> Is DSB( ) , while smp_wmb( ) is DMS( ),
> I just think DSB is much strict than DMS,
> mmm..  so , DSM( )  or DMS ( )  are both ok ?

I think you're getting confused with your barriers. We have two memory
barriers on ARM: dmb and dsb. dmb is sufficient to enforce ordering of
observability. dsb is used to enforce completion.

> The whitepaper I use is here:
> https://www.google.com/#q=cortex+a15+microarchitecture
> 
> the first: [PDF] Exploring the Design of the Cortex-A15 Processor - ARM
> 
> I just search in Google, and you know that qcom don't release
> Much document about its krait cpu's micro architecture details,
> I just use cortex-a15 for a reference, I am not sure if their 
> pipeline ( load/store unit) are the same,

I think the lawyers would have a field day if the pipelines were the same!
You really can't use an A15 slide-deck to infer micro-architectural details
about Krait.

Please can you test the patch I sent you yesterday?

Will

  reply	other threads:[~2013-10-11 11:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10  5:16 Wang, Yalin
2013-10-10  9:48 ` Will Deacon
2013-10-10 10:22   ` Wang, Yalin
2013-10-10 11:03     ` Will Deacon
2013-10-10 11:26       ` Wang, Yalin
2013-10-10 14:18         ` Will Deacon
2013-10-11  1:50           ` Wang, Yalin
2013-10-11 11:02             ` Will Deacon [this message]
2013-10-11 11:14               ` Wang, Yalin
2013-10-17  1:51                 ` Wang, Yalin
2013-10-17 10:41                   ` Will Deacon
2013-10-18  1:41                     ` Wang, Yalin

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=20131011110247.GF14732@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=Arthur.Peng@sonymobile.com \
    --cc=Bojie.Zhang@sonymobile.com \
    --cc=Raghavendra.Alevoor@sonymobile.com \
    --cc=Yalin.Wang@sonymobile.com \
    --cc=Youcai1.Gu@sonymobile.com \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®