From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f199.google.com (mail-io0-f199.google.com [209.85.223.199]) by kanga.kvack.org (Postfix) with ESMTP id 0BCD16B0024 for ; Thu, 22 Feb 2018 21:24:21 -0500 (EST) Received: by mail-io0-f199.google.com with SMTP id e186so6379279iof.9 for ; Thu, 22 Feb 2018 18:24:21 -0800 (PST) Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id q133sor867298ioe.69.2018.02.22.18.24.20 for (Google Transport Security); Thu, 22 Feb 2018 18:24:20 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20180222020633.GC27147@rodete-desktop-imager.corp.google.com> <20180222024620.47691-1-dancol@google.com> <20180223020130.GA115990@rodete-desktop-imager.corp.google.com> From: Daniel Colascione Date: Thu, 22 Feb 2018 18:24:18 -0800 Message-ID: Subject: Re: [PATCH] Synchronize task mm counters on demand Content-Type: multipart/alternative; boundary="089e0826eb208f45710565d7dbea" Sender: owner-linux-mm@kvack.org List-ID: To: Minchan Kim Cc: linux-mm@kvack.org, Peter Zijlstra --089e0826eb208f45710565d7dbea Content-Type: text/plain; charset="UTF-8" On Thu, Feb 22, 2018 at 6:09 PM, Daniel Colascione wrote: > Thanks for taking a look. > > On Feb 22, 2018 6:01 PM, "Minchan Kim" wrote: > > > diff --git a/include/linux/mm.h b/include/linux/mm.h > > index ad06d42adb1a..f8129afebbdd 100644 > > --- a/include/linux/mm.h > > +++ b/include/linux/mm.h > > @@ -1507,14 +1507,28 @@ extern int mprotect_fixup(struct vm_area_struct > *vma, > > */ > > int __get_user_pages_fast(unsigned long start, int nr_pages, int write, > > struct page **pages); > > + > > +#ifdef SPLIT_RSS_COUNTING > > +/* Flush all task-buffered MM counters to the mm */ > > +void sync_mm_rss_all_users(struct mm_struct *mm); > > Really heavy functioin iterates all of processes and threads. > > > Just all processes and the threads of each process attached to the mm. > Maybe that's not much better. > Another option would be to maintain a list (with the list_head in the mm) of all the tasks with unflushed counters. This way, we at least wouldn't have to scan the world. --089e0826eb208f45710565d7dbea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On T= hu, Feb 22, 2018 at 6:09 PM, Daniel Colascione <dancol@google.com><= /span> wrote:
Thanks for t= aking a look.

On Feb 22, 2018 6:01 PM, "= Minchan Kim" <minchan@kernel.org> wrote:
> diff --git a/includ= e/linux/mm.h b/include/linux/mm.h
> index ad06d42adb1a..f8129afebbdd 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1507,14 +1507,28 @@ extern int mprotect_fixup(struct vm_area_struc= t *vma,
>=C2=A0 =C2=A0*/
>=C2=A0 int __get_user_pages_fast(unsigned long start, int nr_pages, int= write,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0struct page **pages);
> +
> +#ifdef SPLIT_RSS_COUNTING
> +/* Flush all task-buffered MM counters to the mm */
> +void sync_mm_rss_all_users(struct mm_struct *mm);

Really heavy functioin iterates all of processes and threads.

Just all processes and the threads of each process attached to the mm.= Maybe that's not much better.

<= div>
Another option would be to maintain a list (with the lis= t_head in the mm) of all the tasks with unflushed counters. This way, we at= least wouldn't have to scan the world.
--089e0826eb208f45710565d7dbea-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org