From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) by kanga.kvack.org (Postfix) with ESMTP id 2A0902802FF for ; Thu, 16 Jul 2015 15:05:00 -0400 (EDT) Received: by iebmu5 with SMTP id mu5so62315646ieb.1 for ; Thu, 16 Jul 2015 12:05:00 -0700 (PDT) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com. [2607:f8b0:4001:c05::22f]) by mx.google.com with ESMTPS id 69si7225079iop.75.2015.07.16.12.04.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 12:04:59 -0700 (PDT) Received: by igvi1 with SMTP id i1so20140477igv.1 for ; Thu, 16 Jul 2015 12:04:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150716092841.GA2001@esperanza> References: <20150716092841.GA2001@esperanza> Date: Thu, 16 Jul 2015 12:04:59 -0700 Message-ID: Subject: Re: [PATCH -mm v8 4/7] proc: add kpagecgroup file From: Andres Lagar-Cavilla Content-Type: multipart/alternative; boundary=089e0118260872eeb3051b02bf64 Sender: owner-linux-mm@kvack.org List-ID: To: Vladimir Davydov Cc: Andrew Morton , Minchan Kim , Raghavendra K T , Johannes Weiner , Michal Hocko , Greg Thelen , Michel Lespinasse , David Rientjes , Pavel Emelyanov , Cyrill Gorcunov , Jonathan Corbet , linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org --089e0118260872eeb3051b02bf64 Content-Type: text/plain; charset=UTF-8 On Thu, Jul 16, 2015 at 2:28 AM, Vladimir Davydov wrote: > On Wed, Jul 15, 2015 at 12:03:18PM -0700, Andres Lagar-Cavilla wrote: > > For both /proc/kpage* interfaces you add (and more critically for the > > rmap-causing one, kpageidle): > > > > It's a good idea to do cond_sched(). Whether after each pfn, each Nth > > pfn, each put_user, I leave to you, but a reasonable cadence is > > needed, because user-space can call this on the entire physical > > address space, and that's a lot of work to do without re-scheduling. > > I really don't think it's necessary. These files can only be > read/written by the root, who has plenty ways to kill the system anyway. > The program that is allowed to read/write these files must be conscious > and do it in batches of reasonable size. AFAICS the same reasoning > already lays behind /proc/kpagecount and /proc/kpageflag, which also do > not thrust the "right" batch size on their readers. > Beg to disagree. You're conflating intended use with system health. A cond_sched() is a one-liner. Andres > > Thanks, > Vladimir > -- Andres Lagar-Cavilla | Google Kernel Team | andreslc@google.com --089e0118260872eeb3051b02bf64 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Jul 16, 2015 at 2:28 AM, Vladimir Davydov <= ;vdavydov@paral= lels.com> wrote:
On Wed, Jul 15, 2015 at 12:03:18PM -0700, Andres Lagar-Cavilla wro= te:
> For both /proc/kpage* interfaces you add (and more critically for the<= br> > rmap-causing one, kpageidle):
>
> It's a good idea to do cond_sched(). Whether after each pfn, each = Nth
> pfn, each put_user, I leave to you, but a reasonable cadence is
> needed, because user-space can call this on the entire physical
> address space, and that's a lot of work to do without re-schedulin= g.

I really don't think it's necessary. These files can only be=
read/written by the root, who has plenty ways to kill the system anyway. The program that is allowed to read/write these files must be conscious
and do it in batches of reasonable size. AFAICS the same reasoning
already lays behind /proc/kpagecount and /proc/kpageflag, which also do
not thrust the "right" batch size on their readers.

Beg to disagree. You're conflating intended use = with system health. A cond_sched() is a one-liner.

Andres=C2=A0

Thanks,
Vladimir



--
Andres Lagar-Cavilla=C2=A0|=C2=A0Google Kernel Team |=C2=A0andreslc@google.com=C2=A0
--089e0118260872eeb3051b02bf64-- -- 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