Re: [PATCH 1/3] filemap: Allow __filemap_get_folio to allocate large folios

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> On Sun, May 21, 2023 at 09:02:36AM +0800, Wang Yugui wrote:
> > > +static inline unsigned fgp_order(size_t size)
> > > +{
> > > +	unsigned int shift = ilog2(size);
> > > +
> > > +	if (shift <= PAGE_SHIFT)
> > > +		return 0;
> > > +	return (shift - PAGE_SHIFT) << 26;
> > 
> > int overflow will happen when size > 0.5M(2**19)?
> 
> I don't see it?
> 
> size == 1 << 20;
> 
> shift = 20;
> return (20 - 12) << 26;
> 
> Looks like about 1 << 29 to me.

sorry that I wrongly
1) wrongly conside PAGE_SHIFT as 13 from arch/alpha/include/asm/page.h
it should be 12 from arch/x86/include/asm/page_types.h.

2) wrongly conside
	(20 - 12) << 26
as
	1<< (20 - 12) << 26

Best Regards
Wang Yugui (wangyugui@xxxxxxxxxxxx)
2023/05/21





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux