linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported
@ 2025-11-21 19:48 Gregory Price
  2025-11-21 19:48 ` [RESEND PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group Gregory Price
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Price @ 2025-11-21 19:48 UTC (permalink / raw)
  To: linux-mm; +Cc: kernel-team, muchun.song, osalvador, david, linux-kernel

Simplify if-true-return-true-else-false logic.

Signed-off-by: Gregory Price <gourry@gourry.net>
Acked-by: David Hildenbrand <david@redhat.com>
---
 include/linux/hugetlb.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index eb21619206af..d5282d52493b 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -876,12 +876,9 @@ static inline void folio_clear_hugetlb_hwpoison(struct folio *folio)
 #ifndef arch_hugetlb_migration_supported
 static inline bool arch_hugetlb_migration_supported(struct hstate *h)
 {
-	if ((huge_page_shift(h) == PMD_SHIFT) ||
+	return ((huge_page_shift(h) == PMD_SHIFT) ||
 		(huge_page_shift(h) == PUD_SHIFT) ||
-			(huge_page_shift(h) == PGDIR_SHIFT))
-		return true;
-	else
-		return false;
+		(huge_page_shift(h) == PGDIR_SHIFT));
 }
 #endif
 #else
-- 
2.51.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RESEND PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group
  2025-11-21 19:48 [RESEND PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported Gregory Price
@ 2025-11-21 19:48 ` Gregory Price
  2025-11-28 11:46   ` David Hildenbrand (Red Hat)
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Price @ 2025-11-21 19:48 UTC (permalink / raw)
  To: linux-mm
  Cc: kernel-team, muchun.song, osalvador, david, linux-kernel, Andrew Morton

sysctl bits are mostly-read values.

Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gregory Price <gourry@gourry.net>
Acked-by: Oscar Salvador <osalvador@suse.de>
---
 include/linux/hugetlb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index d5282d52493b..d6705157c41d 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -172,7 +172,7 @@ bool hugetlbfs_pagecache_present(struct hstate *h,
 
 struct address_space *hugetlb_folio_mapping_lock_write(struct folio *folio);
 
-extern int sysctl_hugetlb_shm_group;
+extern int sysctl_hugetlb_shm_group __read_mostly;
 extern struct list_head huge_boot_pages[MAX_NUMNODES];
 
 void hugetlb_bootmem_alloc(void);
-- 
2.51.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group
  2025-11-21 19:48 ` [RESEND PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group Gregory Price
@ 2025-11-28 11:46   ` David Hildenbrand (Red Hat)
  0 siblings, 0 replies; 3+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-28 11:46 UTC (permalink / raw)
  To: Gregory Price, linux-mm
  Cc: kernel-team, muchun.song, osalvador, linux-kernel, Andrew Morton

On 11/21/25 20:48, Gregory Price wrote:
> sysctl bits are mostly-read values.
> 
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Gregory Price <gourry@gourry.net>
> Acked-by: Oscar Salvador <osalvador@suse.de>
> ---

Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-28 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-21 19:48 [RESEND PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported Gregory Price
2025-11-21 19:48 ` [RESEND PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group Gregory Price
2025-11-28 11:46   ` David Hildenbrand (Red Hat)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox