Hi Sean,

I can confirm that using only hw:mem_page_size=large on used flavor is working  with 2MB hugepage. 

Anyway, I'm still curious about how Nova selects the hugepage size there is 2MB and 1GB hugepage on the hypervisor and I only put hw:mem_page_size=large on used flavor. Maybe you can explain more about this.

Best regards.

On Mon, Feb 13, 2023, 9:27 PM Sean Mooney <smooney@redhat.com> wrote:
On Mon, 2023-02-13 at 21:21 +0700, Lazuardi Nasution wrote:
> Hi Sean,
>
> Thank you for your explanation. I want to use the 2MB hugepage. So, do you
> mean that I have to put hw:mem_page_size=large on used flavor and
> hw_mem_page_size=2MB used image? What is the difference with current
> hw:mem_page_size=2MB on used flavor only?

in general we recomend agains using explict page size unless required after extensive performance testing

so generally i would just suggest using hw:mem_page_size=large in the flaovr.

if you need to use exiplcit page size for a specifc VNF we advise that you set hw_mem_page_size=2MB
on the image.

That way if you hae 1 flavor with hw:mem_page_size=large and 3 images one with hw_mem_page_size=2MB
another with hw_mem_page_size=1G and a third with hw_mem_page_size not set all 3 images can use the same
flavor.

you should prefer to keep the flaovrs generic by using hw_mem_page_size=large|small|any and only set explict page
zises in the images that need that granularity.

you can set explcit pages sizes in the flavor too but it leasds to a combinitorial flavor explostion and is gernerally
required. in 90% of cases hw:mem_page_size=large in the flavor is all that is requried.
>
> Best regards.
>
> On Mon, Feb 13, 2023 at 8:45 PM Sean Mooney <smooney@redhat.com> wrote:
>
> > On Mon, 2023-02-13 at 18:22 +0700, Lazuardi Nasution wrote:
> > > Hi,
> > >
> > > There is a weird situation if it is not a bug.
> > >
> > Its not a bug
> >
> > hw_mem_page_size can be used in the image only if
> > hw:mem_page_size=larage or  hw:mem_page_size=any
> >
> > in the case of  hw:mem_page_size=large the image can be used to choose a
> > speccific hugepage size
> >
> > hw:mem_page_size=large  hw_mem_page_size=1G
> >
> > hw:mem_page_size=any will by default be the same as hw:mem_page_size=small
> > and use the smallest pagezise
> > which is typically 4k. the differnece bettwen hw:mem_page_size=any and
> > hw:mem_page_size=small is
> > hw:mem_page_size=any allows the image to set any value for
> > hw_mem_page_size.
> > so
> > hw:mem_page_size=any and hw_mem_page_size=large is valid where as
> > hw:mem_page_size=small and hw_mem_page_size=large is not and will raise an
> > error.
> >
> > when hugepage support was added it was decided that permission form the
> > operator was required
> > to allow you to request hugepages via the image which is why the flavor
> > must have and hw_mem_page_size=large|any
> > set.
> >
> > >  Hugepage instance launching
> > > is working if I put hw:mem_page_size on the used flavor. But, when I try
> > > the same launching configuration and change hw:mem_page_size on used
> > flavor
> > > to hw_mem_page_size on used image, it cannot work as expected. It seems
> > > that this issue is like on
> > > https://bugzilla.redhat.com/show_bug.cgi?id=1791132, but it still
> > happens
> > > on Zed. Is this an old bug? Should I submit a bug report for this?
> > no we cloased https://bugzilla.redhat.com/show_bug.cgi?id=1791132 as not
> > a bug because they were not aware of this requriement.
> > >
> > > Best regards.
> >
> >