Skip to content

Commit afcd481

Browse files
committed
Merge tag 'mm-hotfixes-stable-2024-06-26-17-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "13 hotfixes, 7 are cc:stable. All are MM related apart from a MAINTAINERS update. There is no identifiable theme here - just singleton patches in various places" * tag 'mm-hotfixes-stable-2024-06-26-17-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/memory: don't require head page for do_set_pmd() mm/page_alloc: Separate THP PCP into movable and non-movable categories nfs: drop the incorrect assertion in nfs_swap_rw() mm/migrate: make migrate_pages_batch() stats consistent MAINTAINERS: TPM DEVICE DRIVER: update the W-tag selftests/mm:fix test_prctl_fork_exec return failure mm: convert page type macros to enum ocfs2: fix DIO failure due to insufficient transaction credits kasan: fix bad call to unpoison_slab_object mm: handle profiling for fake memory allocations during compaction mm/slab: fix 'variable obj_exts set but not used' warning /proc/pid/smaps: add mseal info for vma mm: fix incorrect vbq reference in purge_fragmented_block
2 parents 24ca36a + ab1ffc8 commit afcd481

File tree

20 files changed

+117
-53
lines changed

20 files changed

+117
-53
lines changed

Documentation/filesystems/proc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ encoded manner. The codes are the following:
571571
um userfaultfd missing tracking
572572
uw userfaultfd wr-protect tracking
573573
ss shadow stack page
574+
sl sealed
574575
== =======================================
575576

576577
Note that there is no guarantee that every flag and associated mnemonic will

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22745,7 +22745,7 @@ M: Jarkko Sakkinen <[email protected]>
2274522745
R: Jason Gunthorpe <[email protected]>
2274622746
2274722747
S: Maintained
22748-
W: https://gitlab.com/jarkkojs/linux-tpmdd-test
22748+
W: https://codeberg.org/jarkko/linux-tpmdd-test
2274922749
Q: https://patchwork.kernel.org/project/linux-integrity/list/
2275022750
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
2275122751
F: Documentation/devicetree/bindings/tpm/

fs/nfs/direct.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ int nfs_swap_rw(struct kiocb *iocb, struct iov_iter *iter)
141141
{
142142
ssize_t ret;
143143

144-
VM_BUG_ON(iov_iter_count(iter) != PAGE_SIZE);
145-
146144
if (iov_iter_rw(iter) == READ)
147145
ret = nfs_file_direct_read(iocb, iter, true);
148146
else

fs/ocfs2/aops.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,6 +2366,11 @@ static int ocfs2_dio_end_io_write(struct inode *inode,
23662366
}
23672367

23682368
list_for_each_entry(ue, &dwc->dw_zero_list, ue_node) {
2369+
ret = ocfs2_assure_trans_credits(handle, credits);
2370+
if (ret < 0) {
2371+
mlog_errno(ret);
2372+
break;
2373+
}
23692374
ret = ocfs2_mark_extent_written(inode, &et, handle,
23702375
ue->ue_cpos, 1,
23712376
ue->ue_phys,

fs/ocfs2/journal.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,23 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks)
445445
return status;
446446
}
447447

448+
/*
449+
* Make sure handle has at least 'nblocks' credits available. If it does not
450+
* have that many credits available, we will try to extend the handle to have
451+
* enough credits. If that fails, we will restart transaction to have enough
452+
* credits. Similar notes regarding data consistency and locking implications
453+
* as for ocfs2_extend_trans() apply here.
454+
*/
455+
int ocfs2_assure_trans_credits(handle_t *handle, int nblocks)
456+
{
457+
int old_nblks = jbd2_handle_buffer_credits(handle);
458+
459+
trace_ocfs2_assure_trans_credits(old_nblks);
460+
if (old_nblks >= nblocks)
461+
return 0;
462+
return ocfs2_extend_trans(handle, nblocks - old_nblks);
463+
}
464+
448465
/*
449466
* If we have fewer than thresh credits, extend by OCFS2_MAX_TRANS_DATA.
450467
* If that fails, restart the transaction & regain write access for the

fs/ocfs2/journal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *osb,
243243
int ocfs2_commit_trans(struct ocfs2_super *osb,
244244
handle_t *handle);
245245
int ocfs2_extend_trans(handle_t *handle, int nblocks);
246+
int ocfs2_assure_trans_credits(handle_t *handle,
247+
int nblocks);
246248
int ocfs2_allocate_extend_trans(handle_t *handle,
247249
int thresh);
248250

fs/ocfs2/ocfs2_trace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2577,6 +2577,8 @@ DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_commit_cache_end);
25772577

25782578
DEFINE_OCFS2_INT_INT_EVENT(ocfs2_extend_trans);
25792579

2580+
DEFINE_OCFS2_INT_EVENT(ocfs2_assure_trans_credits);
2581+
25802582
DEFINE_OCFS2_INT_EVENT(ocfs2_extend_trans_restart);
25812583

25822584
DEFINE_OCFS2_INT_INT_EVENT(ocfs2_allocate_extend_trans);

fs/proc/task_mmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
706706
#endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
707707
#ifdef CONFIG_X86_USER_SHADOW_STACK
708708
[ilog2(VM_SHADOW_STACK)] = "ss",
709+
#endif
710+
#ifdef CONFIG_64BIT
711+
[ilog2(VM_SEALED)] = "sl",
709712
#endif
710713
};
711714
size_t i;

include/linux/mm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ extern unsigned int kobjsize(const void *objp);
406406
#define VM_ALLOW_ANY_UNCACHED VM_NONE
407407
#endif
408408

409+
#ifdef CONFIG_64BIT
410+
/* VM is sealed, in vm_flags */
411+
#define VM_SEALED _BITUL(63)
412+
#endif
413+
409414
/* Bits set in the VMA until the stack is in its final location */
410415
#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY)
411416

include/linux/mmzone.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,12 @@ enum zone_watermarks {
654654
};
655655

656656
/*
657-
* One per migratetype for each PAGE_ALLOC_COSTLY_ORDER. One additional list
658-
* for THP which will usually be GFP_MOVABLE. Even if it is another type,
659-
* it should not contribute to serious fragmentation causing THP allocation
660-
* failures.
657+
* One per migratetype for each PAGE_ALLOC_COSTLY_ORDER. Two additional lists
658+
* are added for THP. One PCP list is used by GPF_MOVABLE, and the other PCP list
659+
* is used by GFP_UNMOVABLE and GFP_RECLAIMABLE.
661660
*/
662661
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
663-
#define NR_PCP_THP 1
662+
#define NR_PCP_THP 2
664663
#else
665664
#define NR_PCP_THP 0
666665
#endif

0 commit comments

Comments
 (0)