We should activate swap-backed executable folios (e.g. tmpfs) after first
usage so that executable code gets yet better chance to stay in memory.
Suggested-by: Huang, Ying <[email protected]>
Signed-off-by: Miaohe Lin <[email protected]>
Reviewed-by: Huang, Ying <[email protected]>
Cc: Joonsoo Kim <[email protected]>
---
mm/vmscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 7dcc8cf4526f..82e6fa83c472 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1415,9 +1415,9 @@ static enum page_references folio_check_references(struct folio *folio,
return PAGEREF_ACTIVATE;
/*
- * Activate file-backed executable folios after first usage.
+ * Activate executable folios after first usage.
*/
- if ((vm_flags & VM_EXEC) && !folio_test_swapbacked(folio))
+ if (vm_flags & VM_EXEC)
return PAGEREF_ACTIVATE;
return PAGEREF_KEEP;
--
2.23.0
On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote:
> On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <[email protected]> wrote:
>
> > We should activate swap-backed executable folios (e.g. tmpfs) after first
> > usage so that executable code gets yet better chance to stay in memory.
>
> Does this not erase the intended effect of Joonsoo's b518154e59a
> ("mm/vmscan: protect the workingset on anonymous LRU")?
I don't think so. This is only for executable folios (vm_flags &
VM_EXEC). The behavior for all other anonymous pages are not affected.
Best Regards,
Huang, Ying
On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <[email protected]> wrote:
> We should activate swap-backed executable folios (e.g. tmpfs) after first
> usage so that executable code gets yet better chance to stay in memory.
Does this not erase the intended effect of Joonsoo's b518154e59a
("mm/vmscan: protect the workingset on anonymous LRU")?
On 2022/4/26 10:02, [email protected] wrote:
> On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote:
>> On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <[email protected]> wrote:
>>
>>> We should activate swap-backed executable folios (e.g. tmpfs) after first
>>> usage so that executable code gets yet better chance to stay in memory.
>>
>> Does this not erase the intended effect of Joonsoo's b518154e59a
>> ("mm/vmscan: protect the workingset on anonymous LRU")?
>
> I don't think so. This is only for executable folios (vm_flags &
> VM_EXEC). The behavior for all other anonymous pages are not affected.
>
Agree. Only executable folios are changed! Thanks both!
> Best Regards,
> Huang, Ying
>
> .
>
On Wed, 2022-04-27 at 13:08 +0900, Joonsoo Kim wrote:
> Hello,
>
> 2022년 4월 26일 (화) 오후 3:58, Miaohe Lin <[email protected]>님이 작성:
> >
> > On 2022/4/26 10:02, [email protected] wrote:
> > > On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote:
> > > > On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <[email protected]> wrote:
> > > >
> > > > > We should activate swap-backed executable folios (e.g. tmpfs) after first
> > > > > usage so that executable code gets yet better chance to stay in memory.
>
> Missing activation for swap-backed executable page is the intended operation.
> So, I disagree with this patch until some numbers are provided.
> See following discussion.
>
> https://lore.kernel.org/all/[email protected]/T/#u
Thanks for your pointer. Now I understood more about this. I agree to
keep the original behavior unless we can prove the change with numbers.
Best Regards,
Huang, Ying
Hello,
2022년 4월 26일 (화) 오후 3:58, Miaohe Lin <[email protected]>님이 작성:
>
> On 2022/4/26 10:02, [email protected] wrote:
> > On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote:
> >> On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <[email protected]> wrote:
> >>
> >>> We should activate swap-backed executable folios (e.g. tmpfs) after first
> >>> usage so that executable code gets yet better chance to stay in memory.
Missing activation for swap-backed executable page is the intended operation.
So, I disagree with this patch until some numbers are provided.
See following discussion.
https://lore.kernel.org/all/[email protected]/T/#u
Thanks.