From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Davydov Subject: Re: [PATCH -mm v8 4/7] proc: add kpagecgroup file Date: Fri, 17 Jul 2015 12:27:44 +0300 Message-ID: <20150717092744.GF2001@esperanza> References: <20150716092841.GA2001@esperanza> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Transfer-Encoding: 7bit To: Andres Lagar-Cavilla 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Thu, Jul 16, 2015 at 12:04:59PM -0700, Andres Lagar-Cavilla wrote: > 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. I would still prefer not to clutter the code with cond_resched's, but I don't think it's a matter worth arguing upon, so I'll prepare a patch that makes all /proc/kapge* files issue cond_resched periodically and leave it up to Andrew to decide if it should be applied or not. Thanks, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by kanga.kvack.org (Postfix) with ESMTP id D4BC5280319 for ; Fri, 17 Jul 2015 05:28:03 -0400 (EDT) Received: by pdjr16 with SMTP id r16so59740286pdj.3 for ; Fri, 17 Jul 2015 02:28:03 -0700 (PDT) Received: from mx2.parallels.com (mx2.parallels.com. [199.115.105.18]) by mx.google.com with ESMTPS id kv6si17673749pbc.127.2015.07.17.02.28.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2015 02:28:02 -0700 (PDT) Date: Fri, 17 Jul 2015 12:27:44 +0300 From: Vladimir Davydov Subject: Re: [PATCH -mm v8 4/7] proc: add kpagecgroup file Message-ID: <20150717092744.GF2001@esperanza> References: <20150716092841.GA2001@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andres Lagar-Cavilla 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 On Thu, Jul 16, 2015 at 12:04:59PM -0700, Andres Lagar-Cavilla wrote: > 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. I would still prefer not to clutter the code with cond_resched's, but I don't think it's a matter worth arguing upon, so I'll prepare a patch that makes all /proc/kapge* files issue cond_resched periodically and leave it up to Andrew to decide if it should be applied or not. Thanks, Vladimir -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757256AbbGQJ2G (ORCPT ); Fri, 17 Jul 2015 05:28:06 -0400 Received: from mx2.parallels.com ([199.115.105.18]:48019 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbbGQJ2A (ORCPT ); Fri, 17 Jul 2015 05:28:00 -0400 Date: Fri, 17 Jul 2015 12:27:44 +0300 From: Vladimir Davydov To: Andres Lagar-Cavilla CC: Andrew Morton , Minchan Kim , Raghavendra K T , Johannes Weiner , Michal Hocko , Greg Thelen , Michel Lespinasse , David Rientjes , Pavel Emelyanov , Cyrill Gorcunov , Jonathan Corbet , , , , , Subject: Re: [PATCH -mm v8 4/7] proc: add kpagecgroup file Message-ID: <20150717092744.GF2001@esperanza> References: <20150716092841.GA2001@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.30.4.177] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2015 at 12:04:59PM -0700, Andres Lagar-Cavilla wrote: > 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. I would still prefer not to clutter the code with cond_resched's, but I don't think it's a matter worth arguing upon, so I'll prepare a patch that makes all /proc/kapge* files issue cond_resched periodically and leave it up to Andrew to decide if it should be applied or not. Thanks, Vladimir