Re: [PATCH v2 3/5] mm: shmem: add large folio support for tmpfs

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

 




           return BIT(HPAGE_PMD_ORDER);

Why not force-enable all orders (of course, respecting
MAX_PAGECACHE_ORDER and possibly VMA)?

The ‘force’ option will affect the tmpfs mmap()'s huge allocation, which
I intend to handle in a separate patch as we discussed. Additionally,
for the huge page allocation of tmpfs mmap(), I am also considering the
readahead approach for the pagecache.

Okay, we can change this later. Likely force/deny are a blast from the past either way.

[...]

+
+        order = highest_order(within_size_orders);
+        while (within_size_orders) {
+            aligned_index = round_up(index + 1, 1 << order);
+            i_size = max(write_end, i_size_read(inode));
+            i_size = round_up(i_size, PAGE_SIZE);
+            if (i_size >> PAGE_SHIFT >= aligned_index)
+                return within_size_orders;
+
+            order = next_order(&within_size_orders, order);
+        }
           fallthrough;
       case SHMEM_HUGE_ADVISE:
           if (vm_flags & VM_HUGEPAGE)

I think the point here is that "write" -> no VMA -> vm_flags == 0 -> no
code changes needed :)

Yes. Currently the fadvise() have no HUGEPAGE handling, so I will drop
the 'fadvise' in the doc.

Interesting that we documented it :)

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux