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: <CADFvMYKRcqcZSbMz8sHGGknUC7p7i3MvGO5vKabrrzeWj+qUTw@mail.gmail.com>
Date:	Mon, 27 Oct 2014 19:32:47 -0400
From:	Zhihui Zhang <zzhsuny@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	cl@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [percpu] Make the unit size of the first chunk the same
 as other chunks

In pcpu_embed_first_chunk(), we allocate full unit size for each CPU
in the first chunk:

1981                 /* allocate space for the whole group */
1982                 ptr = alloc_fn(cpu, gi->nr_units * ai->unit_size,
atom_size);
1983                 if (!ptr) {
1984                         rc = -ENOMEM;
1985                         goto out_free_areas;
1986                 }


Later we freed unused part:


2009                         /* copy and return the unused part */
2010                         memcpy(ptr, __per_cpu_load, ai->static_size);
2011                         free_fn(ptr + size_sum, ai->unit_size - size_sum);

I am trying to make each CPU to have a full unit size in the first
chunk, same as in all other chunks. Does this make sense?

-Zhihui

On Mon, Oct 27, 2014 at 10:08 AM, Tejun Heo <tj@...nel.org> wrote:
> On Sat, Oct 25, 2014 at 11:05:58AM -0400, Zhihui Zhang wrote:
>> Since we have already allocated the full unit size for the first chunk, we might as well use
>> it so that the unit size are the same for all chunks. The page first chunk allocator already
>> has this effect because it allocates one page at a time.
>
> I'm not following.  Where do we allocate the full unit size for the
> first chunk?
>
> Thanks.
>
> --
> tejun
--
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