Re: [PATCH v5 05/11] mm: split a folio in minimum folio order chunks

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

 



On Wed, May 15, 2024 at 04:32:36PM +0100, Matthew Wilcox wrote:
> On Fri, May 03, 2024 at 02:53:47AM -0700, Luis Chamberlain wrote:
> > +int split_folio_to_list(struct folio *folio, struct list_head *list);
> 
> ...
> 
> > +static inline int split_folio_to_list(struct page *page, struct list_head *list)
> > +{
> 
> Type mismatch.  Surprised the build bots didn't whine yet.

Good catch. As we always enabled CONFIG_THP, we didn't detect this
issue.

> 
> >  
> > +		min_order = mapping_min_folio_order(folio->mapping);
> > +		if (new_order < min_order) {
> > +			VM_WARN_ONCE(1, "Cannot split mapped folio below min-order: %u",
> > +				     min_order);
> > +			ret = -EINVAL;
> > +			goto out;
> > +		}
> 
> Wouldn't we prefer this as:
> 
> 		if (VM_WARN_ONCE(new_order < min_order,
> 				"Cannot split mapped folio below min-order: %u",
> 				min_order) {
> 			ret = -EINVAL;
> 			goto out;
> 		}
> 
I don't think so:
#define VM_WARN_ONCE(cond, format...) (void)WARN_ONCE(cond, format)

So we get a build error as follows:
In file included from ./include/linux/mm.h:6,
                 from mm/huge_memory.c:8:
mm/huge_memory.c: In function ‘split_huge_page_to_list_to_order’:
./include/linux/mmdebug.h:93:39: error: void value not ignored as it ought to be
   93 | #define VM_WARN_ONCE(cond, format...) (void)WARN_ONCE(cond, format)
      |                                       ^
mm/huge_memory.c:3158:21: note: in expansion of macro ‘VM_WARN_ONCE’
 3158 |                 if (VM_WARN_ONCE(new_order < min_order,





[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