linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>
Cc: Barry Song <baohua@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH v2] mm: shmem: remove __shmem_huge_global_enabled()
Date: Wed, 30 Oct 2024 14:09:29 +0100	[thread overview]
Message-ID: <b180047c-fa9a-472a-84e0-69980659166f@redhat.com> (raw)
In-Reply-To: <20241017141457.1169092-2-wangkefeng.wang@huawei.com>

On 17.10.24 16:14, Kefeng Wang wrote:
> Remove __shmem_huge_global_enabled() since only one caller,
> and remove repeated check of VM_NOHUGEPAGE/MMF_DISABLE_THP
> as they are checked in shmem_allowable_huge_orders(), also
> remove unnecessary vma parameter.
> 
> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> v2:
> - Add RB and send separately
> 
>   mm/shmem.c | 33 ++++++++++-----------------------
>   1 file changed, 10 insertions(+), 23 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 247c0403af83..e933327d8dac 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -548,17 +548,15 @@ static bool shmem_confirm_swap(struct address_space *mapping,
>   
>   static int shmem_huge __read_mostly = SHMEM_HUGE_NEVER;
>   
> -static bool __shmem_huge_global_enabled(struct inode *inode, pgoff_t index,
> -					loff_t write_end, bool shmem_huge_force,
> -					struct vm_area_struct *vma,
> -					unsigned long vm_flags)
> +static bool shmem_huge_global_enabled(struct inode *inode, pgoff_t index,
> +				      loff_t write_end, bool shmem_huge_force,
> +				      unsigned long vm_flags)

Please use double tabs on the second+ parameter list.

>   {
> -	struct mm_struct *mm = vma ? vma->vm_mm : NULL;
>   	loff_t i_size;
>   
> -	if (!S_ISREG(inode->i_mode))
> +	if (HPAGE_PMD_ORDER > MAX_PAGECACHE_ORDER)
>   		return false;
> -	if (mm && ((vm_flags & VM_NOHUGEPAGE) || test_bit(MMF_DISABLE_THP, &mm->flags)))

But where is this check for shmem_getattr()?

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2024-10-30 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 14:14 [PATCH v2] mm: huge_memory: move file_thp_enabled() into huge_memory.c Kefeng Wang
2024-10-17 14:14 ` [PATCH v2] mm: shmem: remove __shmem_huge_global_enabled() Kefeng Wang
2024-10-30 13:09   ` David Hildenbrand [this message]
2024-11-01  1:07     ` Kefeng Wang
2024-11-04 20:53       ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b180047c-fa9a-472a-84e0-69980659166f@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@arm.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox