lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 Mar 2011 17:26:30 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Justin TerAvest <teravest@...gle.com>
Cc:	vgoyal@...hat.com, jaxboe@...ionio.com, m-ikeda@...jp.nec.com,
	ryov@...inux.co.jp, taka@...inux.co.jp, righi.andrea@...il.com,
	guijianfeng@...fujitsu.com, balbir@...ux.vnet.ibm.com,
	ctalbott@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/8] block,fs,mm: IO cgroup tracking for buffered
 write

On Wed, 23 Mar 2011 10:21:01 -0700
Justin TerAvest <teravest@...gle.com> wrote:

> On Tue, Mar 22, 2011 at 9:52 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@...fujitsu.com> wrote:
> > On Tue, 22 Mar 2011 16:08:49 -0700
> > Justin TerAvest <teravest@...gle.com> wrote:
> >
> >> +static inline void page_cgroup_set_blkio_id(struct page_cgroup *pc,
> >> +                             unsigned long id)
> >> +{
> >> +     unsigned long old, new, prev;
> >> +
> >> +     /* pc->flags isn't lock protected, so we must cmpxchg. */
> >> +     WARN_ON(id >= (1UL << PAGE_TRACKING_ID_BITS));
> >> +     do {
> >> +             new = old = pc->flags;
> >> +             new &= (1UL << PAGE_TRACKING_ID_SHIFT) - 1;
> >> +             new |= (unsigned long)(id << PAGE_TRACKING_ID_SHIFT);
> >> +             prev = cmpxchg(&pc->flags, old, new);
> >> +     } while (prev != old);
> >
> > How to support archs which doesn't have cmpxchg ?
> > At least, you need take care of compile error.
> 
> Hi Kame,
> 
> Is there really no generic cmpxchg()? I thought that was what
> include/asm-generic/cmpxchg-local.h was for.
> 

I'm not sure ;) But I myself tend to avoid to use cmpxchg which
cannot be used in CONFIG_SMP, sometimes.

Thanks,
-Kame



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ