Commit a8cc7432 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-hotfixes-stable-2024-11-03-10-50' of...

Merge tag 'mm-hotfixes-stable-2024-11-03-10-50' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "17 hotfixes.  9 are cc:stable.  13 are MM and 4 are non-MM.

  The usual collection of singletons - please see the changelogs"

* tag 'mm-hotfixes-stable-2024-11-03-10-50' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm: multi-gen LRU: use {ptep,pmdp}_clear_young_notify()
  mm: multi-gen LRU: remove MM_LEAF_OLD and MM_NONLEAF_TOTAL stats
  mm, mmap: limit THP alignment of anonymous mappings to PMD-aligned sizes
  mm: shrinker: avoid memleak in alloc_shrinker_info
  .mailmap: update e-mail address for Eugen Hristev
  vmscan,migrate: fix page count imbalance on node stats when demoting pages
  mailmap: update Jarkko's email addresses
  mm: allow set/clear page_type again
  nilfs2: fix potential deadlock with newly created symlinks
  Squashfs: fix variable overflow in squashfs_readpage_block
  kasan: remove vmalloc_percpu test
  tools/mm: -Werror fixes in page-types/slabinfo
  mm, swap: avoid over reclaim of full clusters
  mm: fix PSWPIN counter for large folios swap-in
  mm: avoid VM_BUG_ON when try to map an anon large folio to zero page.
  mm/codetag: fix null pointer check logic for ref and tag
  mm/gup: stop leaking pinned pages in low memory conditions
parents d5aaa0bc 1d4832be
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -199,7 +199,8 @@ Elliot Berman <quic_eberman@quicinc.com> <eberman@codeaurora.org>
Enric Balletbo i Serra <eballetbo@kernel.org> <enric.balletbo@collabora.com>
Enric Balletbo i Serra <eballetbo@kernel.org> <eballetbo@iseebcn.com>
Erik Kaneda <erik.kaneda@intel.com> <erik.schmauss@intel.com>
Eugen Hristev <eugen.hristev@collabora.com> <eugen.hristev@microchip.com>
Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@microchip.com>
Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@collabora.com>
Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> <ezequiel@collabora.com>
Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
@@ -282,7 +283,7 @@ Jan Glauber <jan.glauber@gmail.com> <jglauber@cavium.com>
Jan Kuliga <jtkuliga.kdev@gmail.com> <jankul@alatek.krakow.pl>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@linux.intel.com>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko@profian.com>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@tuni.fi>
Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@parity.io>
Jason Gunthorpe <jgg@ziepe.ca> <jgg@mellanox.com>
Jason Gunthorpe <jgg@ziepe.ca> <jgg@nvidia.com>
Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com>
+3 −0
Original line number Diff line number Diff line
@@ -157,6 +157,9 @@ static int nilfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
	/* slow symlink */
	inode->i_op = &nilfs_symlink_inode_operations;
	inode_nohighmem(inode);
	mapping_set_gfp_mask(inode->i_mapping,
			     mapping_gfp_constraint(inode->i_mapping,
						    ~__GFP_FS));
	inode->i_mapping->a_ops = &nilfs_aops;
	err = page_symlink(inode, symname, l);
	if (err)
+5 −4
Original line number Diff line number Diff line
@@ -30,7 +30,8 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize,
	int mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1;
	loff_t start_index = folio->index & ~mask;
	loff_t end_index = start_index | mask;
	int i, n, pages, bytes, res = -ENOMEM;
	loff_t index;
	int i, pages, bytes, res = -ENOMEM;
	struct page **page, *last_page;
	struct squashfs_page_actor *actor;
	void *pageaddr;
@@ -45,9 +46,9 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize,
		return res;

	/* Try to grab all the pages covered by the Squashfs block */
	for (i = 0, n = start_index; n <= end_index; n++) {
		page[i] = (n == folio->index) ? target_page :
			grab_cache_page_nowait(target_page->mapping, n);
	for (i = 0, index = start_index; index <= end_index; index++) {
		page[i] = (index == folio->index) ? target_page :
			grab_cache_page_nowait(target_page->mapping, index);

		if (page[i] == NULL)
			continue;
+10 −6
Original line number Diff line number Diff line
@@ -135,18 +135,21 @@ static inline void alloc_tag_sub_check(union codetag_ref *ref) {}
#endif

/* Caller should verify both ref and tag to be valid */
static inline void __alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag)
static inline bool __alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag)
{
	alloc_tag_add_check(ref, tag);
	if (!ref || !tag)
		return;
		return false;

	ref->ct = &tag->ct;
	return true;
}

static inline void alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag)
static inline bool alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag)
{
	__alloc_tag_ref_set(ref, tag);
	if (unlikely(!__alloc_tag_ref_set(ref, tag)))
		return false;

	/*
	 * We need in increment the call counter every time we have a new
	 * allocation or when we split a large allocation into smaller ones.
@@ -154,11 +157,12 @@ static inline void alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *t
	 * counter because when we free each part the counter will be decremented.
	 */
	this_cpu_inc(tag->counters->calls);
	return true;
}

static inline void alloc_tag_add(union codetag_ref *ref, struct alloc_tag *tag, size_t bytes)
{
	alloc_tag_ref_set(ref, tag);
	if (likely(alloc_tag_ref_set(ref, tag)))
		this_cpu_add(tag->counters->bytes, bytes);
}

+3 −4
Original line number Diff line number Diff line
@@ -458,9 +458,7 @@ struct lru_gen_folio {

enum {
	MM_LEAF_TOTAL,		/* total leaf entries */
	MM_LEAF_OLD,		/* old leaf entries */
	MM_LEAF_YOUNG,		/* young leaf entries */
	MM_NONLEAF_TOTAL,	/* total non-leaf entries */
	MM_NONLEAF_FOUND,	/* non-leaf entries found in Bloom filters */
	MM_NONLEAF_ADDED,	/* non-leaf entries added to Bloom filters */
	NR_MM_STATS
@@ -557,7 +555,7 @@ struct lru_gen_memcg {

void lru_gen_init_pgdat(struct pglist_data *pgdat);
void lru_gen_init_lruvec(struct lruvec *lruvec);
void lru_gen_look_around(struct page_vma_mapped_walk *pvmw);
bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw);

void lru_gen_init_memcg(struct mem_cgroup *memcg);
void lru_gen_exit_memcg(struct mem_cgroup *memcg);
@@ -576,8 +574,9 @@ static inline void lru_gen_init_lruvec(struct lruvec *lruvec)
{
}

static inline void lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
static inline bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw)
{
	return false;
}

static inline void lru_gen_init_memcg(struct mem_cgroup *memcg)
Loading