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]
Message-ID: <20070817154804.GC24323@filer.fsl.cs.sunysb.edu>
Date:	Fri, 17 Aug 2007 11:48:04 -0400
From:	Josef Sipek <jsipek@....cs.sunysb.edu>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	miklos@...redi.hu, akpm@...ux-foundation.org, neilb@...e.de,
	dgc@....com, tomoki.sekiyama.qu@...achi.com, nikita@...sterfs.com,
	trond.myklebust@....uio.no, yingchao.zhou@...il.com,
	richard@....demon.co.uk, torvalds@...ux-foundation.org
Subject: Re: [PATCH 02/23] lib: percpu_counter_add

On Thu, Aug 16, 2007 at 09:45:27AM +0200, Peter Zijlstra wrote:
...
> Index: linux-2.6/fs/ext2/balloc.c
> ===================================================================
> --- linux-2.6.orig/fs/ext2/balloc.c
> +++ linux-2.6/fs/ext2/balloc.c
> @@ -163,7 +163,7 @@ static int reserve_blocks(struct super_b
>  			return 0;
>  	}
>  
> -	percpu_counter_mod(&sbi->s_freeblocks_counter, -count);
> +	percpu_counter_add(&sbi->s_freeblocks_counter, -count);

Out of curiosity, I noticed similar thing being done in the vm code, what is
preferred:

	foobar_add(&counter, -num);

or

	foobar_sub(&counter, num);

?

Josef 'Jeff' Sipek.

-- 
Research, n.:
  Consider Columbus:
    He didn't know where he was going.
    When he got there he didn't know where he was.
    When he got back he didn't know where he had been.
    And he did it all on someone else's money.
-
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