Re: [PATCH mm v4 3/4] mm: move cgroup high memory limit setting into struct page_counter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 19, 2020 at 10:19 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> High memory limit is currently recorded directly in
> struct mem_cgroup. We are about to add a high limit
> for swap, move the field to struct page_counter and
> add some helpers.
>
> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>

Reviewed-by: Shakeel Butt <shakeelb@xxxxxxxxxx>

> --- a/include/linux/page_counter.h
> +++ b/include/linux/page_counter.h
...
[snip]
...
>
> +static inline bool page_counter_is_above_high(struct page_counter *counter)
> +{
> +       return page_counter_read(counter) > READ_ONCE(counter->high);
> +}
> +
...
[snip]
...
> --- a/mm/page_counter.c
> +++ b/mm/page_counter.c
> @@ -198,6 +198,11 @@ int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages)
>         }
>  }
>
> +void page_counter_set_high(struct page_counter *counter, unsigned long nr_pages)
> +{
> +       WRITE_ONCE(counter->high, nr_pages);
> +}
> +

Any reason not to make this static inline like
page_counter_is_above_high() and in page_counter.h?



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux