[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Ext2-devel] Re: [PATCH] Link breaks for large NR_CPUS



On Nov 06, 2003  13:58 -0500, Martin Hicks wrote:
> +static int ext3_setup_sbi (struct ext3_sb_info *sbi)
> +{
> +	sbi->s_freeblocks_counter = kmalloc(sizeof(struct percpu_counter), GFP_KERNEL);
> +	if (!sbi->s_freeblocks_counter)
> +		return -ENOMEM;
> +	sbi->s_freeinodes_counter = kmalloc(sizeof(struct percpu_counter), GFP_KERNEL);
> +	if (!sbi->s_freeinodes_counter)
> +		goto out_freeblocks;
> +	sbi->s_dirs_counter = kmalloc(sizeof(struct percpu_counter), GFP_KERNEL);

Another poster mentioned alloc_percpu() which I wasn't aware of.  That might
be preferrable if it does clever things like allocating out of per-cpu pages
or something.  Sorry, I don't know the details of how to use it.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]