* [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless [not found] <1311760070-21532-1-git-send-email-sven@narfation.org> @ 2011-07-27 9:47 ` Sven Eckelmann 2011-07-27 10:59 ` Neil Horman 0 siblings, 1 reply; 4+ messages in thread From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw) To: linux-arch; +Cc: linux-kernel, Sven Eckelmann, Neil Horman, netdev atomic_dec_not_zero is defined for each architecture through <linux/atomic.h> to provide the functionality of atomic_add_unless(x, -1, 0). Signed-off-by: Sven Eckelmann <sven@narfation.org> Cc: Neil Horman <nhorman@tuxdriver.com> Cc: netdev@vger.kernel.org --- net/core/drop_monitor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 7f36b38..ef4a05d 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data); - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) { + if (!atomic_dec_not_zero(&data->dm_hit_count)) { /* * we're already at zero, discard this hit */ -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless 2011-07-27 9:47 ` [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann @ 2011-07-27 10:59 ` Neil Horman 2011-07-27 11:52 ` Sven Eckelmann 0 siblings, 1 reply; 4+ messages in thread From: Neil Horman @ 2011-07-27 10:59 UTC (permalink / raw) To: Sven Eckelmann; +Cc: linux-arch, linux-kernel, netdev On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote: > atomic_dec_not_zero is defined for each architecture through > <linux/atomic.h> to provide the functionality of > atomic_add_unless(x, -1, 0). > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > Cc: Neil Horman <nhorman@tuxdriver.com> > Cc: netdev@vger.kernel.org > --- > net/core/drop_monitor.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c > index 7f36b38..ef4a05d 100644 > --- a/net/core/drop_monitor.c > +++ b/net/core/drop_monitor.c > @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) > struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data); > > > - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) { > + if (!atomic_dec_not_zero(&data->dm_hit_count)) { > /* > * we're already at zero, discard this hit > */ > -- > 1.7.5.4 > > Wheres the patch that creates the per arch definition of this function? I see the other posts in this series went to lkml, but the archives don't have the first in the series anywhere, which ostensibly adds the definition. Neil ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless 2011-07-27 10:59 ` Neil Horman @ 2011-07-27 11:52 ` Sven Eckelmann 2011-07-27 14:25 ` Neil Horman 0 siblings, 1 reply; 4+ messages in thread From: Sven Eckelmann @ 2011-07-27 11:52 UTC (permalink / raw) To: Neil Horman; +Cc: linux-arch, linux-kernel, netdev [-- Attachment #1: Type: text/plain, Size: 1659 bytes --] On Wednesday 27 July 2011 06:59:07 Neil Horman wrote: > On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote: > > atomic_dec_not_zero is defined for each architecture through > > <linux/atomic.h> to provide the functionality of > > atomic_add_unless(x, -1, 0). > > > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > > Cc: Neil Horman <nhorman@tuxdriver.com> > > Cc: netdev@vger.kernel.org > > --- > > > > net/core/drop_monitor.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c > > index 7f36b38..ef4a05d 100644 > > --- a/net/core/drop_monitor.c > > +++ b/net/core/drop_monitor.c > > @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, > > void *location) > > > > struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data); > > > > - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) { > > + if (!atomic_dec_not_zero(&data->dm_hit_count)) { > > > > /* > > > > * we're already at zero, discard this hit > > */ > > Wheres the patch that creates the per arch definition of this function? I > see the other posts in this series went to lkml, but the archives don't > have the first in the series anywhere, which ostensibly adds the > definition. Neil Most architectures don't use a per architecture definition anymore, but a cross-architecture the definition in include/linux/atomic.h. The 01/11 can be found in different archives under the message id 1311760070-21532-1-git-send-email-sven@narfation.org ... for example gmane: http://article.gmane.org/gmane.linux.ports.arm.kernel/126704 Kind regards, Sven [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless 2011-07-27 11:52 ` Sven Eckelmann @ 2011-07-27 14:25 ` Neil Horman 0 siblings, 0 replies; 4+ messages in thread From: Neil Horman @ 2011-07-27 14:25 UTC (permalink / raw) To: Sven Eckelmann; +Cc: linux-arch, linux-kernel, netdev On Wed, Jul 27, 2011 at 01:52:50PM +0200, Sven Eckelmann wrote: > On Wednesday 27 July 2011 06:59:07 Neil Horman wrote: > > On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote: > > > atomic_dec_not_zero is defined for each architecture through > > > <linux/atomic.h> to provide the functionality of > > > atomic_add_unless(x, -1, 0). > > > > > > Signed-off-by: Sven Eckelmann <sven@narfation.org> > > > Cc: Neil Horman <nhorman@tuxdriver.com> > > > Cc: netdev@vger.kernel.org > > > --- > > > > > > net/core/drop_monitor.c | 2 +- > > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > > > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c > > > index 7f36b38..ef4a05d 100644 > > > --- a/net/core/drop_monitor.c > > > +++ b/net/core/drop_monitor.c > > > @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, > > > void *location) > > > > > > struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data); > > > > > > - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) { > > > + if (!atomic_dec_not_zero(&data->dm_hit_count)) { > > > > > > /* > > > > > > * we're already at zero, discard this hit > > > */ > > > > Wheres the patch that creates the per arch definition of this function? I > > see the other posts in this series went to lkml, but the archives don't > > have the first in the series anywhere, which ostensibly adds the > > definition. Neil > > Most architectures don't use a per architecture definition anymore, but a > cross-architecture the definition in include/linux/atomic.h. > > The 01/11 can be found in different archives under the message id > 1311760070-21532-1-git-send-email-sven@narfation.org ... for example gmane: > http://article.gmane.org/gmane.linux.ports.arm.kernel/126704 > > Kind regards, > Sven Ok, thank you, I just didn't see the patch that implemented it in the lkml archive at MARC, and wanted to be sure this wasn't proposed for a different tree than the patch with the definition. Acked-by: Neil Horman <nhorman@tuxdriver.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-27 14:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
2011-07-27 9:47 ` [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann
2011-07-27 10:59 ` Neil Horman
2011-07-27 11:52 ` Sven Eckelmann
2011-07-27 14:25 ` Neil Horman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox