public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* Why don't we have atomic_set_mask()?
@ 2011-03-17 11:36 KyongHo Cho
  2011-03-17 12:07 ` Russell King - ARM Linux
  2011-03-17 12:09 ` Russell King - ARM Linux
  0 siblings, 2 replies; 5+ messages in thread
From: KyongHo Cho @ 2011-03-17 11:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi.

arch/arm/asm/atomic.h defines atomic_clear_mask() but its counterpart,
atomic_set_mask() is not defined.

Don't we need it?

Cho KyongHo.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Why don't we have atomic_set_mask()?
  2011-03-17 11:36 Why don't we have atomic_set_mask()? KyongHo Cho
@ 2011-03-17 12:07 ` Russell King - ARM Linux
  2011-03-17 13:25   ` Detlef Vollmann
  2011-03-17 12:09 ` Russell King - ARM Linux
  1 sibling, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2011-03-17 12:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 17, 2011 at 08:36:15PM +0900, KyongHo Cho wrote:
> arch/arm/asm/atomic.h defines atomic_clear_mask() but its counterpart,
> atomic_set_mask() is not defined.

Nothing other than some s390 drivers seems to use it, so I'd say no.
I also feel that atomic_xxx() is over-used, many times in inappropriate
and buggy ways.

If you want to manipulate bitmasks or bitmaps, then imho you should be
using the bitops or bitmap support rather than atomic stuff.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Why don't we have atomic_set_mask()?
  2011-03-17 11:36 Why don't we have atomic_set_mask()? KyongHo Cho
  2011-03-17 12:07 ` Russell King - ARM Linux
@ 2011-03-17 12:09 ` Russell King - ARM Linux
  2011-03-17 12:24   ` KyongHo Cho
  1 sibling, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2011-03-17 12:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 17, 2011 at 08:36:15PM +0900, KyongHo Cho wrote:
> Hi.
> 
> arch/arm/asm/atomic.h defines atomic_clear_mask() but its counterpart,
> atomic_set_mask() is not defined.
> 
> Don't we need it?

I can't reply to you:

| A message that you sent could not be delivered to one or more of its
| recipients. This is a permanent error. The following address(es) failed:
| 
|   pullip.cho at samsung.com
|     SMTP error from remote mail server after end of data:
|     host mailin.samsung.com [203.254.224.12]: 550 esmtp:
|     protocol deviation

Which basically means that Samsung's MTA is currently broken.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Why don't we have atomic_set_mask()?
  2011-03-17 12:09 ` Russell King - ARM Linux
@ 2011-03-17 12:24   ` KyongHo Cho
  0 siblings, 0 replies; 5+ messages in thread
From: KyongHo Cho @ 2011-03-17 12:24 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux wrote:
> 
> On Thu, Mar 17, 2011 at 08:36:15PM +0900, KyongHo Cho wrote:
> > Hi.
> >
> > arch/arm/asm/atomic.h defines atomic_clear_mask() but its counterpart,
> > atomic_set_mask() is not defined.
> >
> > Don't we need it?
> 
> I can't reply to you:
> 
> | A message that you sent could not be delivered to one or more of its
> | recipients. This is a permanent error. The following address(es) failed:
> |
> |   pullip.cho at samsung.com
> |     SMTP error from remote mail server after end of data:
> |     host mailin.samsung.com [203.254.224.12]: 550 esmtp:
> |     protocol deviation
> 
> Which basically means that Samsung's MTA is currently broken.

I think it is currently ok because I just sent an email from gmail to
@samsung.com.

Thank you!

KyongHo.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Why don't we have atomic_set_mask()?
  2011-03-17 12:07 ` Russell King - ARM Linux
@ 2011-03-17 13:25   ` Detlef Vollmann
  0 siblings, 0 replies; 5+ messages in thread
From: Detlef Vollmann @ 2011-03-17 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/17/11 13:07, Russell King - ARM Linux wrote:
> On Thu, Mar 17, 2011 at 08:36:15PM +0900, KyongHo Cho wrote:
>> arch/arm/asm/atomic.h defines atomic_clear_mask() but its counterpart,
>> atomic_set_mask() is not defined.
>
> Nothing other than some s390 drivers seems to use it, so I'd say no.
> I also feel that atomic_xxx() is over-used, many times in inappropriate
> and buggy ways.
I fully agree.  Simply asking for a atomic_set_mask looks like you're
trying to do something wrong.
The convention is to use those bits as flags, and having the contention
on setting the flag, so you have test_and_set_bit(), and can then
deal with the case where the flag was already set.
Doing that with more than one flag at a time would get pretty complex.

   Detlef

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-17 13:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17 11:36 Why don't we have atomic_set_mask()? KyongHo Cho
2011-03-17 12:07 ` Russell King - ARM Linux
2011-03-17 13:25   ` Detlef Vollmann
2011-03-17 12:09 ` Russell King - ARM Linux
2011-03-17 12:24   ` KyongHo Cho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox