# Re: \[RFC PATCH 08/15\] fs: proc: use PAGES\_PER\_SECTION for page offline checking period.

- From: Mike Rapoport \<rppt@kernel.org\>
- Date: 2021-08-07 10:32:34 
- List: linux-mm
- Page: https://ratatoskr.run/linux-mm/2021/08/211778
- Thread: https://ratatoskr.run/linux-mm/2021/08/1469304/t.md

```text
On Thu, Aug 05, 2021 at 03:02:46PM -0400, Zi Yan wrote:
> From: Zi Yan <ziy@nvidia.com>
> 
> It keeps the existing behavior after MAX_ORDER is increased beyond
> a section size.
> 
> Signed-off-by: Zi Yan <ziy@nvidia.com>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: David Hildenbrand <redacted>
> Cc: Oscar Salvador <osalvador@suse.de>
> Cc: Ying Chen <redacted>
> Cc: Feng Zhou <redacted>
> Cc: <redacted>
> Cc: <redacted>
> Cc: <redacted>
> ---
>  fs/proc/kcore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
> index 3f148759a5fd..77b7ba48fb44 100644
> --- a/fs/proc/kcore.c
> +++ b/fs/proc/kcore.c
> @@ -486,7 +486,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
>  			}
>  		}
>  
> -		if (page_offline_frozen++ % MAX_ORDER_NR_PAGES == 0) {
> +		if (page_offline_frozen++ % PAGES_PER_SECTION == 0) {

The behavior changes here. E.g. with default configuration on x86 instead
of cond_resched() every 2M we get cond_resched() every 128M.

I'm not saying it's wrong but at least it deserves an explanation why.

>  			page_offline_thaw();
>  			cond_resched();
>  			page_offline_freeze();
> -- 
> 2.30.2
> 

-- 
Sincerely yours,
Mike.

```
