[LTP] [PATCH v2 3/5] Hugetlb: Migrating libhugetlbfs fadvise_reserve

Tarun Sahu tsahu@linux.ibm.com
Wed Nov 9 19:40:20 CET 2022


On Nov 09 2022, Cyril Hrubis wrote:
Hi,

--skip
> > +
> > +	if (posix_fadvise(fd, 0, hpage_size, POSIX_FADV_WILLNEED) == -1) {
> > +		tst_res(TFAIL|TERRNO, "fadvise()");
> > +		goto cleanup;
> > +	}
> 
> If we follow how SAFE_MACROS() works this should rather be:
> 
> 	if (posix_fadvise(...)
> 		tst_brk(TBROK|TERRNO, "fadvise()");
>
Yes. I am thinking of adding it to tst_safe_macros (SAFE_POSIX_FADVISE).
But there are other tests, that uses it raw
(https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mincore/mincore04.c).
Was there any reason to not create a SAFE_MACROS for it?

> > +	fadvise_rsvd = SAFE_READ_MEMINFO(MEMINFO_HPAGE_RSVD);
> > +	tst_res(TINFO, "Reserve count after fadvise: %lu", fadvise_rsvd);
> > -- 
> > 2.31.1
> > 
> 
> -- 
> Cyril Hrubis
> chrubis@suse.cz
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp


More information about the ltp mailing list