Re: [PATCH 1/2] smp: use '|=' for csd_lock
在 2013-04-23二的 15:40 -0700,Andrew Morton写道: > On Mon, 22 Apr 2013 13:47:22 +0800 liguang wrote: > > > originally, 'data->flags = CSD_FLAG_LOCK', > > and we use 'data->flags &= ~CSD_FLAG_LOCK' > > for csd_unlock, they are not symmetrix operations > > so use '|=' instead of '='. > > though, now data->flags only hold CSD_FLAG_LOCK, > > it's not so meaningful to use '|=' to set 1 bit, > > and '&= ~' to clear 1 bit. > > > > Signed-off-by: liguang > > --- > > kernel/smp.c |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/kernel/smp.c b/kernel/smp.c > > index 1818dc0..2d5deb4 100644 > > --- a/kernel/smp.c > > +++ b/kernel/smp.c > > @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) > > static void csd_lock(struct call_single_data *data) > > { > > csd_lock_wait(data); > > - data->flags = CSD_FLAG_LOCK; > > + data->flags |= CSD_FLAG_LOCK; > > > > /* > > call_single_data.flags is in fact presently a boolean - we only use one > bit in that word. We could remove all the &=, |=, & and | operations > on call_single_data.flags and treat it as a boolean. That would > probably result in faster and smaller code. > > But leaving the other 31 bits alone and reserved-for-future-use is not > a bad thing. But if we're going to do that we should do it consistently. > > I rewrote your changelog ;) That's fine, Thanks! > > > From: liguang > Subject: kernel/smp.c: use '|=' for csd_lock > > csd_lock() uses assignment to data->flags rather than |=. That is not > buggy at present because only one bit (CSD_FLAG_LOCK) is defined in > call_single_data.flags. > > But it will become buggy if we later add another flag, so fix it now. > > Signed-off-by: liguang > Cc: Peter Zijlstra > Cc: Oleg Nesterov > Cc: Ingo Molnar > Signed-off-by: Andrew Morton > --- > > kernel/smp.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff -puN kernel/smp.c~kernel-smpc-use-=-for-csd_lock kernel/smp.c > --- a/kernel/smp.c~kernel-smpc-use-=-for-csd_lock > +++ a/kernel/smp.c > @@ -110,7 +110,7 @@ static void csd_lock_wait(struct call_si > static void csd_lock(struct call_single_data *data) > { > csd_lock_wait(data); > - data->flags = CSD_FLAG_LOCK; > + data->flags |= CSD_FLAG_LOCK; > > /* >* prevent CPU from reordering the above assignment > _ > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, 22 Apr 2013 13:47:22 +0800 liguang wrote: > originally, 'data->flags = CSD_FLAG_LOCK', > and we use 'data->flags &= ~CSD_FLAG_LOCK' > for csd_unlock, they are not symmetrix operations > so use '|=' instead of '='. > though, now data->flags only hold CSD_FLAG_LOCK, > it's not so meaningful to use '|=' to set 1 bit, > and '&= ~' to clear 1 bit. > > Signed-off-by: liguang > --- > kernel/smp.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/kernel/smp.c b/kernel/smp.c > index 1818dc0..2d5deb4 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) > static void csd_lock(struct call_single_data *data) > { > csd_lock_wait(data); > - data->flags = CSD_FLAG_LOCK; > + data->flags |= CSD_FLAG_LOCK; > > /* call_single_data.flags is in fact presently a boolean - we only use one bit in that word. We could remove all the &=, |=, & and | operations on call_single_data.flags and treat it as a boolean. That would probably result in faster and smaller code. But leaving the other 31 bits alone and reserved-for-future-use is not a bad thing. But if we're going to do that we should do it consistently. I rewrote your changelog ;) From: liguang Subject: kernel/smp.c: use '|=' for csd_lock csd_lock() uses assignment to data->flags rather than |=. That is not buggy at present because only one bit (CSD_FLAG_LOCK) is defined in call_single_data.flags. But it will become buggy if we later add another flag, so fix it now. Signed-off-by: liguang Cc: Peter Zijlstra Cc: Oleg Nesterov Cc: Ingo Molnar Signed-off-by: Andrew Morton --- kernel/smp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN kernel/smp.c~kernel-smpc-use-=-for-csd_lock kernel/smp.c --- a/kernel/smp.c~kernel-smpc-use-=-for-csd_lock +++ a/kernel/smp.c @@ -110,7 +110,7 @@ static void csd_lock_wait(struct call_si static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data->flags = CSD_FLAG_LOCK; + data->flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment _ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, 22 Apr 2013 13:47:22 +0800 liguang lig.f...@cn.fujitsu.com wrote: originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* call_single_data.flags is in fact presently a boolean - we only use one bit in that word. We could remove all the =, |=, and | operations on call_single_data.flags and treat it as a boolean. That would probably result in faster and smaller code. But leaving the other 31 bits alone and reserved-for-future-use is not a bad thing. But if we're going to do that we should do it consistently. I rewrote your changelog ;) From: liguang lig.f...@cn.fujitsu.com Subject: kernel/smp.c: use '|=' for csd_lock csd_lock() uses assignment to data-flags rather than |=. That is not buggy at present because only one bit (CSD_FLAG_LOCK) is defined in call_single_data.flags. But it will become buggy if we later add another flag, so fix it now. Signed-off-by: liguang lig.f...@cn.fujitsu.com Cc: Peter Zijlstra a.p.zijls...@chello.nl Cc: Oleg Nesterov o...@redhat.com Cc: Ingo Molnar mi...@elte.hu Signed-off-by: Andrew Morton a...@linux-foundation.org --- kernel/smp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN kernel/smp.c~kernel-smpc-use-=-for-csd_lock kernel/smp.c --- a/kernel/smp.c~kernel-smpc-use-=-for-csd_lock +++ a/kernel/smp.c @@ -110,7 +110,7 @@ static void csd_lock_wait(struct call_si static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment _ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
在 2013-04-23二的 15:40 -0700,Andrew Morton写道: On Mon, 22 Apr 2013 13:47:22 +0800 liguang lig.f...@cn.fujitsu.com wrote: originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* call_single_data.flags is in fact presently a boolean - we only use one bit in that word. We could remove all the =, |=, and | operations on call_single_data.flags and treat it as a boolean. That would probably result in faster and smaller code. But leaving the other 31 bits alone and reserved-for-future-use is not a bad thing. But if we're going to do that we should do it consistently. I rewrote your changelog ;) That's fine, Thanks! From: liguang lig.f...@cn.fujitsu.com Subject: kernel/smp.c: use '|=' for csd_lock csd_lock() uses assignment to data-flags rather than |=. That is not buggy at present because only one bit (CSD_FLAG_LOCK) is defined in call_single_data.flags. But it will become buggy if we later add another flag, so fix it now. Signed-off-by: liguang lig.f...@cn.fujitsu.com Cc: Peter Zijlstra a.p.zijls...@chello.nl Cc: Oleg Nesterov o...@redhat.com Cc: Ingo Molnar mi...@elte.hu Signed-off-by: Andrew Morton a...@linux-foundation.org --- kernel/smp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN kernel/smp.c~kernel-smpc-use-=-for-csd_lock kernel/smp.c --- a/kernel/smp.c~kernel-smpc-use-=-for-csd_lock +++ a/kernel/smp.c @@ -110,7 +110,7 @@ static void csd_lock_wait(struct call_si static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment _ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, Apr 22, 2013 at 8:30 AM, Sedat Dilek wrote: > On Mon, Apr 22, 2013 at 8:22 AM, li guang wrote: >> 在 2013-04-22一的 08:18 +0200,Sedat Dilek写道: >>> On Mon, Apr 22, 2013 at 7:47 AM, liguang wrote: >>> > originally, 'data->flags = CSD_FLAG_LOCK', >>> > and we use 'data->flags &= ~CSD_FLAG_LOCK' >>> > for csd_unlock, they are not symmetrix operations >>> > so use '|=' instead of '='. >>> > though, now data->flags only hold CSD_FLAG_LOCK, >>> > it's not so meaningful to use '|=' to set 1 bit, >>> > and '&= ~' to clear 1 bit. >>> > >>> >>> Hi, >>> >>> what's the reason I got CCed on this two patches? The ipc-sem-next >>> issue I reported? >> NOPE. ( I tried next-20130419 with 3 ipc-sem-next patches plus your two patches. ) - Sedat - >> sorry, >> just use the result of scripts/get_maintainer.pl >> > > Hmm, really this script memyselfandI as a result? > >>> >>> Against what tree are those patches? >>> They are not compatible with Linux-Next (next-20130419). >> >> main >> > > Andrew renamed data/csd,so it's only 1/2 needing a refresh. > Testing... > > Regards, > - Sedat - > >>> >>> Thanks. >>> >>> Regards, >>> - Sedat - >>> >>> [1] http://marc.info/?t=13663145795=1=2 >>> >>> > Signed-off-by: liguang >>> > --- >>> > kernel/smp.c |2 +- >>> > 1 files changed, 1 insertions(+), 1 deletions(-) >>> > >>> > diff --git a/kernel/smp.c b/kernel/smp.c >>> > index 1818dc0..2d5deb4 100644 >>> > --- a/kernel/smp.c >>> > +++ b/kernel/smp.c >>> > @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data >>> > *data) >>> > static void csd_lock(struct call_single_data *data) >>> > { >>> > csd_lock_wait(data); >>> > - data->flags = CSD_FLAG_LOCK; >>> > + data->flags |= CSD_FLAG_LOCK; >>> > >>> > /* >>> > * prevent CPU from reordering the above assignment >>> > -- >>> > 1.7.2.5 >>> > >> >> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, Apr 22, 2013 at 8:22 AM, li guang wrote: > 在 2013-04-22一的 08:18 +0200,Sedat Dilek写道: >> On Mon, Apr 22, 2013 at 7:47 AM, liguang wrote: >> > originally, 'data->flags = CSD_FLAG_LOCK', >> > and we use 'data->flags &= ~CSD_FLAG_LOCK' >> > for csd_unlock, they are not symmetrix operations >> > so use '|=' instead of '='. >> > though, now data->flags only hold CSD_FLAG_LOCK, >> > it's not so meaningful to use '|=' to set 1 bit, >> > and '&= ~' to clear 1 bit. >> > >> >> Hi, >> >> what's the reason I got CCed on this two patches? The ipc-sem-next >> issue I reported? > > sorry, > just use the result of scripts/get_maintainer.pl > Hmm, really this script memyselfandI as a result? >> >> Against what tree are those patches? >> They are not compatible with Linux-Next (next-20130419). > > main > Andrew renamed data/csd,so it's only 1/2 needing a refresh. Testing... Regards, - Sedat - >> >> Thanks. >> >> Regards, >> - Sedat - >> >> [1] http://marc.info/?t=13663145795=1=2 >> >> > Signed-off-by: liguang >> > --- >> > kernel/smp.c |2 +- >> > 1 files changed, 1 insertions(+), 1 deletions(-) >> > >> > diff --git a/kernel/smp.c b/kernel/smp.c >> > index 1818dc0..2d5deb4 100644 >> > --- a/kernel/smp.c >> > +++ b/kernel/smp.c >> > @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data >> > *data) >> > static void csd_lock(struct call_single_data *data) >> > { >> > csd_lock_wait(data); >> > - data->flags = CSD_FLAG_LOCK; >> > + data->flags |= CSD_FLAG_LOCK; >> > >> > /* >> > * prevent CPU from reordering the above assignment >> > -- >> > 1.7.2.5 >> > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
在 2013-04-22一的 08:18 +0200,Sedat Dilek写道: > On Mon, Apr 22, 2013 at 7:47 AM, liguang wrote: > > originally, 'data->flags = CSD_FLAG_LOCK', > > and we use 'data->flags &= ~CSD_FLAG_LOCK' > > for csd_unlock, they are not symmetrix operations > > so use '|=' instead of '='. > > though, now data->flags only hold CSD_FLAG_LOCK, > > it's not so meaningful to use '|=' to set 1 bit, > > and '&= ~' to clear 1 bit. > > > > Hi, > > what's the reason I got CCed on this two patches? The ipc-sem-next > issue I reported? sorry, just use the result of scripts/get_maintainer.pl > > Against what tree are those patches? > They are not compatible with Linux-Next (next-20130419). main > > Thanks. > > Regards, > - Sedat - > > [1] http://marc.info/?t=13663145795=1=2 > > > Signed-off-by: liguang > > --- > > kernel/smp.c |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/kernel/smp.c b/kernel/smp.c > > index 1818dc0..2d5deb4 100644 > > --- a/kernel/smp.c > > +++ b/kernel/smp.c > > @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) > > static void csd_lock(struct call_single_data *data) > > { > > csd_lock_wait(data); > > - data->flags = CSD_FLAG_LOCK; > > + data->flags |= CSD_FLAG_LOCK; > > > > /* > > * prevent CPU from reordering the above assignment > > -- > > 1.7.2.5 > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, Apr 22, 2013 at 7:47 AM, liguang wrote: > originally, 'data->flags = CSD_FLAG_LOCK', > and we use 'data->flags &= ~CSD_FLAG_LOCK' > for csd_unlock, they are not symmetrix operations > so use '|=' instead of '='. > though, now data->flags only hold CSD_FLAG_LOCK, > it's not so meaningful to use '|=' to set 1 bit, > and '&= ~' to clear 1 bit. > Hi, what's the reason I got CCed on this two patches? The ipc-sem-next issue I reported? Against what tree are those patches? They are not compatible with Linux-Next (next-20130419). Thanks. Regards, - Sedat - [1] http://marc.info/?t=13663145795=1=2 > Signed-off-by: liguang > --- > kernel/smp.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/kernel/smp.c b/kernel/smp.c > index 1818dc0..2d5deb4 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) > static void csd_lock(struct call_single_data *data) > { > csd_lock_wait(data); > - data->flags = CSD_FLAG_LOCK; > + data->flags |= CSD_FLAG_LOCK; > > /* > * prevent CPU from reordering the above assignment > -- > 1.7.2.5 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, Apr 22, 2013 at 7:47 AM, liguang lig.f...@cn.fujitsu.com wrote: originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Hi, what's the reason I got CCed on this two patches? The ipc-sem-next issue I reported? Against what tree are those patches? They are not compatible with Linux-Next (next-20130419). Thanks. Regards, - Sedat - [1] http://marc.info/?t=13663145795r=1w=2 Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment -- 1.7.2.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
在 2013-04-22一的 08:18 +0200,Sedat Dilek写道: On Mon, Apr 22, 2013 at 7:47 AM, liguang lig.f...@cn.fujitsu.com wrote: originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Hi, what's the reason I got CCed on this two patches? The ipc-sem-next issue I reported? sorry, just use the result of scripts/get_maintainer.pl Against what tree are those patches? They are not compatible with Linux-Next (next-20130419). main Thanks. Regards, - Sedat - [1] http://marc.info/?t=13663145795r=1w=2 Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment -- 1.7.2.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, Apr 22, 2013 at 8:22 AM, li guang lig.f...@cn.fujitsu.com wrote: 在 2013-04-22一的 08:18 +0200,Sedat Dilek写道: On Mon, Apr 22, 2013 at 7:47 AM, liguang lig.f...@cn.fujitsu.com wrote: originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Hi, what's the reason I got CCed on this two patches? The ipc-sem-next issue I reported? sorry, just use the result of scripts/get_maintainer.pl Hmm, really this script memyselfandI as a result? Against what tree are those patches? They are not compatible with Linux-Next (next-20130419). main Andrew renamed data/csd,so it's only 1/2 needing a refresh. Testing... Regards, - Sedat - Thanks. Regards, - Sedat - [1] http://marc.info/?t=13663145795r=1w=2 Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment -- 1.7.2.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] smp: use '|=' for csd_lock
On Mon, Apr 22, 2013 at 8:30 AM, Sedat Dilek sedat.di...@gmail.com wrote: On Mon, Apr 22, 2013 at 8:22 AM, li guang lig.f...@cn.fujitsu.com wrote: 在 2013-04-22一的 08:18 +0200,Sedat Dilek写道: On Mon, Apr 22, 2013 at 7:47 AM, liguang lig.f...@cn.fujitsu.com wrote: originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Hi, what's the reason I got CCed on this two patches? The ipc-sem-next issue I reported? NOPE. ( I tried next-20130419 with 3 ipc-sem-next patches plus your two patches. ) - Sedat - sorry, just use the result of scripts/get_maintainer.pl Hmm, really this script memyselfandI as a result? Against what tree are those patches? They are not compatible with Linux-Next (next-20130419). main Andrew renamed data/csd,so it's only 1/2 needing a refresh. Testing... Regards, - Sedat - Thanks. Regards, - Sedat - [1] http://marc.info/?t=13663145795r=1w=2 Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment -- 1.7.2.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] smp: use '|=' for csd_lock
originally, 'data->flags = CSD_FLAG_LOCK', and we use 'data->flags &= ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data->flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '&= ~' to clear 1 bit. Signed-off-by: liguang --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data->flags = CSD_FLAG_LOCK; + data->flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] smp: use '|=' for csd_lock
originally, 'data-flags = CSD_FLAG_LOCK', and we use 'data-flags = ~CSD_FLAG_LOCK' for csd_unlock, they are not symmetrix operations so use '|=' instead of '='. though, now data-flags only hold CSD_FLAG_LOCK, it's not so meaningful to use '|=' to set 1 bit, and '= ~' to clear 1 bit. Signed-off-by: liguang lig.f...@cn.fujitsu.com --- kernel/smp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 1818dc0..2d5deb4 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -109,7 +109,7 @@ static void csd_lock_wait(struct call_single_data *data) static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data-flags = CSD_FLAG_LOCK; + data-flags |= CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment -- 1.7.2.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/