public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Sven Eckelmann <sven@narfation.org>
Cc: linux-kernel@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	linux-ia64@vger.kernel.org,
	Hirokazu Takata <takata@linux-m32r.org>,
	linux-m32r@ml.linux-m32r.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux390@de.ibm.com, linux-s390@vger.kernel.org,
	Paul Mundt <lethal@linux-sh.org>,
	linux-sh@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	linux-arch@vger.kernel.org
Subject: Re: [PATCHv2] atomic: add *_dec_not_zero
Date: Mon, 23 May 2011 09:27:40 +0200	[thread overview]
Message-ID: <20110523072740.GA2377@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1305748194-23351-1-git-send-email-sven@narfation.org>

On Wed, May 18, 2011 at 09:49:54PM +0200, Sven Eckelmann wrote:
> Introduce an *_dec_not_zero operation.  Make this a special case of
> *_add_unless because batman-adv uses atomic_dec_not_zero in different
> places like re-broadcast queue or aggregation queue management. There
> are other non-final patches which may also want to use this macro.
[...]
> ---
> This is actually the same patch as before, but I am still waiting for
> some (N)Acks for ia64, m32r, s390, sh and generic.
[...]
> diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
> index d9db138..09972c3 100644
> --- a/arch/s390/include/asm/atomic.h
> +++ b/arch/s390/include/asm/atomic.h
> @@ -109,6 +109,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
>  }
> 
>  #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
> +#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
> 
>  #undef __CS_LOOP
> 
> @@ -326,6 +327,7 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v)
>  #define atomic64_dec_return(_v)		atomic64_sub_return(1, _v)
>  #define atomic64_dec_and_test(_v)	(atomic64_sub_return(1, _v) == 0)
>  #define atomic64_inc_not_zero(v)	atomic64_add_unless((v), 1, 0)
> +#define atomic64_dec_not_zero(v)	atomic64_add_unless((v), -1, 0)
> 
>  #define smp_mb__before_atomic_dec()	smp_mb()
>  #define smp_mb__after_atomic_dec()	smp_mb()

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>

      parent reply	other threads:[~2011-05-23  7:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110503213035.BySm5c6tn2tLoFS6bfCJCaJaoqElVg4DR082eX87zxQ@z>
2011-05-03 21:30 ` [PATCH] atomic: add *_dec_not_zero Sven Eckelmann
     [not found]   ` <20110504044446.lJLF0ZMWKUHj4eiCV-T-ILb_HCHVrdqmZ-mc4ut-uIM@z>
2011-05-04  4:44     ` Mike Frysinger
     [not found]       ` <20110504150404.01AtVDvCl3oSQLSjpp9wQu5dPhA-EyNUfEO5IDw7aaA@z>
2011-05-04 15:04         ` James Bottomley
     [not found]   ` <20110504061255.2hZ_0xtfqoWFl0q5SoiGvxhEo5bRmXiGWjsEgIDK1OY@z>
2011-05-04  6:12     ` David Miller
     [not found]   ` <20110504070312.OmyEKIKXgtE4wDdsmkSpq3_R596CSJT9n_U-liskE6g@z>
2011-05-04  7:03     ` Ingo Molnar
     [not found]   ` <20110504080553.lrgglP6XMgOw5VQis2f4_O9SUhAN4YahJnqq1PB7ne8@z>
2011-05-04  8:05     ` David Laight
     [not found]       ` <20110504082116.edaVBt9TMYFrLHKNX1HtQ9fUlqiAqhvFDvkdVIwPf6Y@z>
2011-05-04  8:21         ` Sven Eckelmann
2011-05-04  8:33       ` Mike Frysinger
     [not found]   ` <20110504110207.wFscIfZvDhOx6mpCSIyGsnMs-6w-gwQw5XwuW6egdVE@z>
2011-05-04 11:02     ` Ralf Baechle
     [not found]   ` <20110504115319.dwdT6vRj507zJ6D0eGLySfPx0WroTSYuRFYJpunQTXo@z>
2011-05-04 11:53     ` David Howells
     [not found]   ` <20110504120916.EgRF5IJKXwpcLl-U0HOpzgO710bynO8bBPVNBzvd-q0@z>
2011-05-04 12:09     ` Chris Metcalf
     [not found]   ` <20110504121751.SyIjtQThuFe1adMF3ilmv-hRC8wXxrg6LqOeyzYOxzQ@z>
2011-05-04 12:17     ` Geert Uytterhoeven
     [not found]   ` <20110504172736.HyTDiETThabZZynBDIbrpS3MQMU4HqPEXHI55IwZxkY@z>
2011-05-04 17:27     ` Will Deacon
2011-05-04 18:13   ` Matt Turner
     [not found]   ` <20110508092403.mZH3fxoHzJhFXxl79cAxJ32c3hMjwjgx1sIxE8vz_8E@z>
2011-05-08  9:24     ` Russell King - ARM Linux
     [not found]       ` <20110508093348.uG_IDeFz5xlNQZdXcR_45_sTL1w17ErF0-ReSLLxlnM@z>
2011-05-08  9:33         ` Sven Eckelmann
     [not found]           ` <20110509023843.wfLIMeEkYcxtlo_moLpLhcU834QEHVApdLzcyQol9qg@z>
2011-05-09  2:38             ` Mike Frysinger
     [not found]   ` <20110508221539.LA-ABgzrAloJ151NAs71qeh5JM4_Wb7Q32-Qb_4Apf8@z>
2011-05-08 22:15     ` Benjamin Herrenschmidt
2011-05-18 19:49   ` [PATCHv2] " Sven Eckelmann
     [not found]     ` <20110523071346.0rwpHoc4VgxDgU-4WU-sVsuKWyQ1uO1J7vskq_AxBGQ@z>
2011-05-23  7:13       ` Paul Mundt
2011-05-23  7:27     ` Heiko Carstens [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=20110523072740.GA2377@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=arnd@arndb.de \
    --cc=fenghua.yu@intel.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m32r@ml.linux-m32r.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sven@narfation.org \
    --cc=takata@linux-m32r.org \
    --cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox