Skip to contentSkip to conversation

f2fs: cache more dentry pages

PATCH Superseded zangyangyang1 via Linux-f2fs-devel 1 participant 4 messages Nov 11, 2024 – Nov 22, 2024 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: cache more dentry pages

f2fs_find_data_page is used to find dentry pages,
I think we should cache more dentry pages.

---
 fs/f2fs/data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/data.c +1 -1
index 402e00d54c0b..71ca987fe7cd 100644
@@ -1286,7 +1286,7 @@ struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index,
        struct address_space *mapping = inode->i_mapping;
        struct page *page;
 
-       page = find_get_page(mapping, index);
+       page = find_get_page_flags(mapping, index, FGP_ACCESSED);
        if (page && PageUptodate(page))
                return page;
        f2fs_put_page(page, 0);

--
2.43.2

#/******���ʼ����丽������С�׹�˾�ı�����Ϣ�������ڷ��͸������ַ���г��ĸ��˻�Ⱥ�顣��ֹ�κ����������κ���ʽʹ�ã�������������ȫ���򲿷ֵ�й¶�����ơ���ɢ�������ʼ��е���Ϣ������������˱��ʼ������������绰���ʼ�֪ͨ�����˲�ɾ�����ʼ��� This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#1 lore raw
Quoted 2 lines · On 2024/11/11 12:31, zangyangyang1 wrote:

f2fs_find_data_page is used to find dentry pages,
I think we should cache more dentry pages.

Hi,

Did you suffer any issue w/o this change?

Thanks,

Quoted 20 lines
---
  fs/f2fs/data.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/data.c +1 -2
index 402e00d54c0b..71ca987fe7cd 100644
@@ -1286,7 +1286,7 @@ struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index,
         struct address_space *mapping = inode->i_mapping;
         struct page *page;
 
-       page = find_get_page(mapping, index);
+       page = find_get_page_flags(mapping, index, FGP_ACCESSED);
         if (page && PageUptodate(page))
                 return page;
         f2fs_put_page(page, 0);
--
Quoted 1 line

2.43.2

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
Quoted 7 lines · On 2024/11/11 12:31, zangyangyang1 wrote:
Quoted 2 lines

f2fs_find_data_page is used to find dentry pages,
I think we should cache more dentry pages.

Hi,

Did you suffer any issue w/o this change?

Hi,
No issue encountered, I just think that dentry pages are more important, so we can put them in the active LRU list in memory to avoid being recycled.

Thanks,

Quoted 17 lines

Thanks,

Quoted 14 lines
---
  fs/f2fs/data.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/data.c +0 -0
index 402e00d54c0b..71ca987fe7cd 100644
@@ -1286,7 +1286,7 @@ struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index,
         struct address_space *mapping = inode->i_mapping;
         struct page *page;
 
Quoted 7 lines
Quoted 7 lines
fs/f2fs/data.c +1 -2
-       page = find_get_page(mapping, index);
+       page = find_get_page_flags(mapping, index, FGP_ACCESSED);
         if (page && PageUptodate(page))
                 return page;
         f2fs_put_page(page, 0);
--

2.43.2

#/******���ʼ����丽������С�׹�˾�ı�����Ϣ�������ڷ��͸������ַ���г��ĸ��˻�Ⱥ�顣��ֹ�κ����������κ���ʽʹ�ã�������������ȫ���򲿷ֵ�й¶�����ơ���ɢ�������ʼ��е���Ϣ������������˱��ʼ������������绰���ʼ�֪ͨ�����˲�ɾ�����ʼ��� This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author Reviewed-by Chao Yu on v1 1/1
#3 lore raw
In reply to zangyangyang1 via Linux-f2fs-devel
Quoted 2 lines · On 2024/11/11 12:31, zangyangyang1 wrote:

f2fs_find_data_page is used to find dentry pages,
I think we should cache more dentry pages.

How about?

"While traversing dir entries in dentry page, it's better to refresh current accessed page in lru list by using FGP_ACCESSED flag, otherwise, such page may has less chance to survive during memory reclaim, result in causing additional IO when revisiting dentry page."

Quoted 2 lines

I think it's better to improve commit description, anyway, code part looks good to me.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel