> -----Original Message----- > From: Jens Axboe [mailto:axboe@xxxxxxxxx] > Sent: Monday, May 23, 2022 2:13 PM > To: Vincent Fu <vincent.fu@xxxxxxxxxxx>; fio@xxxxxxxxxxxxxxx > Subject: Re: [PATCH 5/6] mem: try to parse /proc/meminfo to get huge > page size > > On 5/23/22 11:57 AM, Vincent Fu wrote: > > Instead of relying on a platform-specific default huge page size, try to > > parse /proc/meminfo to get the huge page size when it is not explicitly > > specified as an option. > > It's really sad that there isn't a nice way to get this information, but > parsing meminfo will only get you one of them. Eg on my laptop: > > axboe@m1 ~> cat /proc/meminfo | grep -i size > Hugepagesize: 32768 kB > > But if you look in: > > axboe@m1 ~> ls /sys/kernel/mm/hugepages/ > hugepages-1048576kB/ hugepages-2048kB/ hugepages-32768kB/ > > and each directory has entries for increasing the number of them and > how > many are currently there. > > Parsing /sys/kernel/mm/hugepages/ is probably a better idea than > meminfo. > Looking into this more, it seems that to do this 100% correctly will take more time than I have. However, I think this patch is still an improvement over a build-time default. How about if I revise the documentation to say that fio will parse /proc/meminfo (which reports the default huge page size) but YMMV and users need to explicitly set the huge page size if they are using something else?