lkml.org 
[lkml]   [2018]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] x86/boot/KASLR: Add two functions for 1GB huge pages handling

* Baoquan He <bhe@redhat.com> wrote:

> On 06/21/18 at 05:01pm, Ingo Molnar wrote:
> >
> > * Baoquan He <bhe@redhat.com> wrote:
> >
> > > +/* Store the number of 1GB huge pages which user specified.*/
> > > +static unsigned long max_gb_huge_pages;
> > > +
> > > +static int parse_gb_huge_pages(char *param, char* val)
> > > +{
> > > + char *p;
> > > + u64 mem_size;
> > > + static bool gbpage_sz = false;
> > > +
> > > + if (!strcmp(param, "hugepagesz")) {
> > > + p = val;
> > > + mem_size = memparse(p, &p);
> > > + if (mem_size == PUD_SIZE) {
> > > + if (gbpage_sz)
> > > + warn("Repeadly set hugeTLB page size of 1G!\n");
> > > + gbpage_sz = true;
> > > + } else
> > > + gbpage_sz = false;
> > > + } else if (!strcmp(param, "hugepages") && gbpage_sz) {
> > > + p = val;
> > > + max_gb_huge_pages = simple_strtoull(p, &p, 0);
> > > + debug_putaddr(max_gb_huge_pages);
> > > + }
> > > +}
> >
> > This function has at least one style problem and one typo.
> >
> > Also, we don't put statics in the middle of function variable blocks.
> >
>
> Sorry, I will check all of them carefully and repost according to your
> comments.

Thanks!

Ingo

\
 
 \ /
  Last update: 2018-06-24 09:14    [W:0.131 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site