Web lists-archives.com

Re: [External] Re: vmscan: Reclaim unevictable pages




I am using kernel version 4.14.65 (on Android pie [ARM]).

No additional patches applied on top of vanilla.(Core MM).

If  I change in the vmscan.c as below patch, it will work. 

Regards,
Pankaj 
 

  
From: Michal Hocko <mhocko@xxxxxxxxxx>
Sent: 14 March 2019 14:11:20
To: Pankaj Suryawanshi
Cc: linux-kernel@xxxxxxxxxxxxxxx; minchan@xxxxxxxxxx
Subject: [External] Re: vmscan: Reclaim unevictable pages
  

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


On Thu 14-03-19 08:23:10, Pankaj Suryawanshi wrote:
>
> Below is the Error Msg :
>
> [   24.718792] page dumped because: VM_BUG_ON_PAGE(PageLRU(page) || PageUnevictable(page))
> [   24.726949] page->mem_cgroup:bd008c00
> [   24.730693] ------------[ cut here ]------------
> [   24.735304] kernel BUG at mm/vmscan.c:1350!
> [   24.739478] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM

Just curious. Which kernel version is that? Are there any addional
patches applied on top of vanilla?

> Solved the issue by below patch.
>
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index be56e2e..2e51edc 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -990,15 +990,17 @@ static unsigned long shrink_page_list(struct list_head *page_list,
>                 page = lru_to_page(page_list);
>                 list_del(&page->lru);
>
>                if (!trylock_page(page)) {
>                         goto keep;
>                }
>
>                 VM_BUG_ON_PAGE(PageActive(page), page);
>
>                 sc->nr_scanned++;
>
>                 if (unlikely(!page_evictable(page)))
> -                       goto activate_locked;
> +                      goto cull_mlocked;
>
>                 if (!sc->may_unmap && page_mapped(page))
>                         goto keep_locked;
> @@ -1331,6 +1333,12 @@ static unsigned long shrink_page_list(struct list_head *page_list,
>                 } else
>                         list_add(&page->lru, &free_pages);
>                 continue;
> +cull_mlocked:
> +                if (PageSwapCache(page))
> +                        try_to_free_swap(page);
> +                unlock_page(page);
> +                list_add(&page->lru, &ret_pages);
> +                continue;
>
>  activate_locked:
>                 /* Not a candidate for swapping, so reclaim swap space. */
>
>
>
>
> From: Pankaj Suryawanshi
> Sent: 14 March 2019 13:23:53
> To: linux-kernel@xxxxxxxxxxxxxxx
> Cc: minchan@xxxxxxxxxx
> Subject: vmscan: Reclaim unevictable pages
>
>
>
> Hello ,
>
> shrink_page_list() returns , number of pages reclaimed, when pages is unevictable it returns VM_BUG_ON_PAGE(PageLRU(page) || PageUnevicatble(page),page);
>
> We can add the unevictable pages in reclaim list in shrink_page_list(), return total number of reclaim pages including unevictable pages, let the caller handle unevictable pages.
>
> Regards,
> Pankaj
>
> ************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended  solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you  are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please  delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused  by any virus transmitted by this email. *************************************************************************************************************************************************************

--
Michal Hocko
SUSE Labs