mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm:vmscan: fix return negative unneed to detect VM_EXEC
@ 2023-10-25 15:44 Zhiguo Jiang
  2023-11-06 18:40 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Zhiguo Jiang @ 2023-10-25 15:44 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kernel; +Cc: opensource.kernel, Zhiguo Jiang

The reason that folio_referenced() returns negative is because
rwc.contended is 1, vm_flags is 0 at this time and so there is
no need to detect VM_EXEC. And only when referenced > 0, pra->vm_flags
will be filled with vma->vm_flags in folio_referenced_one().

Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e587dafeef94..f0b4325cccd4 100755
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2095,7 +2095,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
 
 		/* Referenced or rmap lock contention: rotate */
 		if (folio_referenced(folio, 0, sc->target_mem_cgroup,
-				     &vm_flags) != 0) {
+				     &vm_flags) > 0) {
 			/*
 			 * Identify referenced, file-backed active folios and
 			 * give them one more trip around the active list. So
--
2.39.0


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

* Re: [PATCH] mm:vmscan: fix return negative unneed to detect VM_EXEC
  2023-10-25 15:44 [PATCH] mm:vmscan: fix return negative unneed to detect VM_EXEC Zhiguo Jiang
@ 2023-11-06 18:40 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2023-11-06 18:40 UTC (permalink / raw)
  To: Zhiguo Jiang; +Cc: linux-mm, linux-kernel, opensource.kernel

On Wed, 25 Oct 2023 23:44:32 +0800 Zhiguo Jiang <justinjiang@vivo.com> wrote:

> The reason that folio_referenced() returns negative is because
> rwc.contended is 1, vm_flags is 0 at this time and so there is
> no need to detect VM_EXEC. And only when referenced > 0, pra->vm_flags
> will be filled with vma->vm_flags in folio_referenced_one().
> 
> ...
>
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2095,7 +2095,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
>  
>  		/* Referenced or rmap lock contention: rotate */
>  		if (folio_referenced(folio, 0, sc->target_mem_cgroup,
> -				     &vm_flags) != 0) {
> +				     &vm_flags) > 0) {
>  			/*
>  			 * Identify referenced, file-backed active folios and
>  			 * give them one more trip around the active list. So

I suspect this email did not make it through the linux-mm server.  I
can't find it in my archive or at https://lore.kernel.org/linux-mm/.

So please resend?  Prior to doing so, please update the changelog to
describe the before- and after- userspace visible effects of the
change.

Thanks.

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

end of thread, other threads:[~2023-11-06 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 15:44 [PATCH] mm:vmscan: fix return negative unneed to detect VM_EXEC Zhiguo Jiang
2023-11-06 18:40 ` Andrew Morton

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

all inboxes | Powered by JetHome®