Message ID | 20220425111232.23182-4-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | A few cleanup and fixup patches for vmscan | expand |
On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <linmiaohe@huawei.com> 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 Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote: > On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <linmiaohe@huawei.com> 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 2022/4/26 10:02, ying.huang@intel.com wrote: > On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote: >> On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <linmiaohe@huawei.com> 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 > > . >
Hello, 2022년 4월 26일 (화) 오후 3:58, Miaohe Lin <linmiaohe@huawei.com>님이 작성: > > On 2022/4/26 10:02, ying.huang@intel.com wrote: > > On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote: > >> On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <linmiaohe@huawei.com> 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/20200316161208.GB67986@cmpxchg.org/T/#u Thanks.
On Wed, 2022-04-27 at 13:08 +0900, Joonsoo Kim wrote: > Hello, > > 2022년 4월 26일 (화) 오후 3:58, Miaohe Lin <linmiaohe@huawei.com>님이 작성: > > > > On 2022/4/26 10:02, ying.huang@intel.com wrote: > > > On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote: > > > > On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <linmiaohe@huawei.com> 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/20200316161208.GB67986@cmpxchg.org/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
On 2022/4/27 14:10, ying.huang@intel.com wrote: > On Wed, 2022-04-27 at 13:08 +0900, Joonsoo Kim wrote: >> Hello, >> >> 2022년 4월 26일 (화) 오후 3:58, Miaohe Lin <linmiaohe@huawei.com>님이 작성: >>> >>> On 2022/4/26 10:02, ying.huang@intel.com wrote: >>>> On Mon, 2022-04-25 at 14:07 -0700, Andrew Morton wrote: >>>>> On Mon, 25 Apr 2022 19:12:29 +0800 Miaohe Lin <linmiaohe@huawei.com> 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/20200316161208.GB67986@cmpxchg.org/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. > Many thanks both! I will keep the original behavior. :) > Best Regards, > Huang, Ying > > > . >
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;