Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1165029 > unrolled thread

Re: [RFC 2/3] mm: make optimistic check for swapin readahead

Started byRik van Riel <riel@redhat.com>
First post2015-06-15 07:50 +0200
Last post2015-06-15 08:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC 2/3] mm: make optimistic check for swapin readahead Rik van Riel <riel@redhat.com> - 2015-06-15 07:50 +0200
    Re: [RFC 2/3] mm: make optimistic check for swapin readahead Leon Romanovsky <leon@leon.nu> - 2015-06-15 08:10 +0200
      Re: [RFC 2/3] mm: make optimistic check for swapin readahead Rik van Riel <riel@redhat.com> - 2015-06-15 08:40 +0200

#1165029 — Re: [RFC 2/3] mm: make optimistic check for swapin readahead

FromRik van Riel <riel@redhat.com>
Date2015-06-15 07:50 +0200
SubjectRe: [RFC 2/3] mm: make optimistic check for swapin readahead
Message-ID<pBvrs-2G5-5@gated-at.bofh.it>
On 06/15/2015 01:40 AM, Leon Romanovsky wrote:
> On Sun, Jun 14, 2015 at 6:04 PM, Ebru Akagunduz
> <ebru.akagunduz@gmail.com> wrote:
>> This patch makes optimistic check for swapin readahead
>> to increase thp collapse rate. Before getting swapped
>> out pages to memory, checks them and allows up to a
>> certain number. It also prints out using tracepoints
>> amount of unmapped ptes.
>>
>> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>

>> @@ -2639,11 +2640,11 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
>>  {
>>         pmd_t *pmd;
>>         pte_t *pte, *_pte;
>> -       int ret = 0, none_or_zero = 0;
>> +       int ret = 0, none_or_zero = 0, unmapped = 0;
>>         struct page *page;
>>         unsigned long _address;
>>         spinlock_t *ptl;
>> -       int node = NUMA_NO_NODE;
>> +       int node = NUMA_NO_NODE, max_ptes_swap = HPAGE_PMD_NR/8;
> Sorry for asking, my knoweldge of THP is very limited, but why did you
> choose this default value?
> From the discussion followed by your patch
> (https://lkml.org/lkml/2015/2/27/432), I got an impression that it is
> not necessary right value.

I believe that Ebru's main focus for this initial version of
the patch series was to get the _mechanism_ (patch 3) right,
while having a fairly simple policy to drive it.

Any suggestions on when it is a good idea to bring in pages
from swap, and whether to treat resident-in-swap-cache pages
differently from need-to-be-paged-in pages, and what other
factors should be examined, are very welcome...

-- 
All rights reversed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1165039

FromLeon Romanovsky <leon@leon.nu>
Date2015-06-15 08:10 +0200
Message-ID<pBvKN-3hf-7@gated-at.bofh.it>
In reply to#1165029
On Mon, Jun 15, 2015 at 8:43 AM, Rik van Riel <riel@redhat.com> wrote:
> On 06/15/2015 01:40 AM, Leon Romanovsky wrote:
>> On Sun, Jun 14, 2015 at 6:04 PM, Ebru Akagunduz
>> <ebru.akagunduz@gmail.com> wrote:
>>> This patch makes optimistic check for swapin readahead
>>> to increase thp collapse rate. Before getting swapped
>>> out pages to memory, checks them and allows up to a
>>> certain number. It also prints out using tracepoints
>>> amount of unmapped ptes.
>>>
>>> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
>
>>> @@ -2639,11 +2640,11 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
>>>  {
>>>         pmd_t *pmd;
>>>         pte_t *pte, *_pte;
>>> -       int ret = 0, none_or_zero = 0;
>>> +       int ret = 0, none_or_zero = 0, unmapped = 0;
>>>         struct page *page;
>>>         unsigned long _address;
>>>         spinlock_t *ptl;
>>> -       int node = NUMA_NO_NODE;
>>> +       int node = NUMA_NO_NODE, max_ptes_swap = HPAGE_PMD_NR/8;
>> Sorry for asking, my knoweldge of THP is very limited, but why did you
>> choose this default value?
>> From the discussion followed by your patch
>> (https://lkml.org/lkml/2015/2/27/432), I got an impression that it is
>> not necessary right value.
>
> I believe that Ebru's main focus for this initial version of
> the patch series was to get the _mechanism_ (patch 3) right,
> while having a fairly simple policy to drive it.
>
> Any suggestions on when it is a good idea to bring in pages
> from swap, and whether to treat resident-in-swap-cache pages
> differently from need-to-be-paged-in pages, and what other
> factors should be examined, are very welcome...
My concern with these patches that they deal with specific
load/scenario (most of the application returned back from swap). In
scenario there only 10% of data will be required, it theoretically can
bring upto 80% data (70% waste).

>
> --
> All rights reversed



-- 
Leon Romanovsky | Independent Linux Consultant
        www.leon.nu | leon@leon.nu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1165042

FromRik van Riel <riel@redhat.com>
Date2015-06-15 08:40 +0200
Message-ID<pBwdP-3OT-3@gated-at.bofh.it>
In reply to#1165039
On 06/15/2015 02:08 AM, Leon Romanovsky wrote:
> On Mon, Jun 15, 2015 at 8:43 AM, Rik van Riel <riel@redhat.com> wrote:
>> On 06/15/2015 01:40 AM, Leon Romanovsky wrote:
>>> On Sun, Jun 14, 2015 at 6:04 PM, Ebru Akagunduz
>>> <ebru.akagunduz@gmail.com> wrote:
>>>> This patch makes optimistic check for swapin readahead
>>>> to increase thp collapse rate. Before getting swapped
>>>> out pages to memory, checks them and allows up to a
>>>> certain number. It also prints out using tracepoints
>>>> amount of unmapped ptes.
>>>>
>>>> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
>>
>>>> @@ -2639,11 +2640,11 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
>>>>  {
>>>>         pmd_t *pmd;
>>>>         pte_t *pte, *_pte;
>>>> -       int ret = 0, none_or_zero = 0;
>>>> +       int ret = 0, none_or_zero = 0, unmapped = 0;
>>>>         struct page *page;
>>>>         unsigned long _address;
>>>>         spinlock_t *ptl;
>>>> -       int node = NUMA_NO_NODE;
>>>> +       int node = NUMA_NO_NODE, max_ptes_swap = HPAGE_PMD_NR/8;
>>> Sorry for asking, my knoweldge of THP is very limited, but why did you
>>> choose this default value?
>>> From the discussion followed by your patch
>>> (https://lkml.org/lkml/2015/2/27/432), I got an impression that it is
>>> not necessary right value.
>>
>> I believe that Ebru's main focus for this initial version of
>> the patch series was to get the _mechanism_ (patch 3) right,
>> while having a fairly simple policy to drive it.
>>
>> Any suggestions on when it is a good idea to bring in pages
>> from swap, and whether to treat resident-in-swap-cache pages
>> differently from need-to-be-paged-in pages, and what other
>> factors should be examined, are very welcome...
> My concern with these patches that they deal with specific
> load/scenario (most of the application returned back from swap). In
> scenario there only 10% of data will be required, it theoretically can
> bring upto 80% data (70% waste).

The chosen threshold ensures that the remaining non-resident
4kB pages in a THP are only brought in if 7/8th (or 87.5%) of
the pages are already resident.

-- 
All rights reversed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web