diff mbox series

[v2,2/2] mm:vmscan: the ref clean dirty folio skip unmap

Message ID 20231019134211.329-3-justinjiang@vivo.com (mailing list archive)
State New
Headers show
Series mm: the dirty folio unmap redundantly | expand

Commit Message

zhiguojiang Oct. 19, 2023, 1:42 p.m. UTC
If the dirty folio in folio_list which is inactive file lru is
FOLIOREF_RECLAIM_CLEAN, the dirty folio can skip unmap in advance
to reduce recyling time.

Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---

Changelog:
v1->v2:
1. The dirty folio in folio_list wich FOLIOREF_RECLAIM_CLEAN skip
   unmap in advance.

 mm/vmscan.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Matthew Wilcox (Oracle) Oct. 20, 2023, 3:29 a.m. UTC | #1
On Thu, Oct 19, 2023 at 09:42:11PM +0800, Zhiguo Jiang wrote:
> +++ b/mm/vmscan.c
> @@ -1225,7 +1225,10 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
>  			stat->nr_ref_keep += nr_pages;
>  			goto keep_locked;
>  		case FOLIOREF_RECLAIM:
> +			break;
>  		case FOLIOREF_RECLAIM_CLEAN:
> +			if (dirty)
> +				goto activate_locked;

Why activate_locked and not keep_locked?
zhiguojiang Oct. 20, 2023, 3:37 a.m. UTC | #2
在 2023/10/20 11:29, Matthew Wilcox 写道:
> On Thu, Oct 19, 2023 at 09:42:11PM +0800, Zhiguo Jiang wrote:
>> +++ b/mm/vmscan.c
>> @@ -1225,7 +1225,10 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
>>   			stat->nr_ref_keep += nr_pages;
>>   			goto keep_locked;
>>   		case FOLIOREF_RECLAIM:
>> +			break;
>>   		case FOLIOREF_RECLAIM_CLEAN:
>> +			if (dirty)
>> +				goto activate_locked;
> Why activate_locked and not keep_locked?
Hi,
This is  a mistake, should be keep_locked.
diff mbox series

Patch

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e067269275a5..e587dafeef94 100755
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1225,7 +1225,10 @@  static unsigned int shrink_folio_list(struct list_head *folio_list,
 			stat->nr_ref_keep += nr_pages;
 			goto keep_locked;
 		case FOLIOREF_RECLAIM:
+			break;
 		case FOLIOREF_RECLAIM_CLEAN:
+			if (dirty)
+				goto activate_locked;
 			; /* try to reclaim the folio below */
 		}