From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx111.postini.com [74.125.245.111]) by kanga.kvack.org (Postfix) with SMTP id 571206B0031 for ; Mon, 5 Aug 2013 14:04:26 -0400 (EDT) Received: by mail-ob0-f175.google.com with SMTP id xn12so6106920obc.6 for ; Mon, 05 Aug 2013 11:04:25 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 5 Aug 2013 11:04:25 -0700 Message-ID: Subject: swap behavior during fast allocation From: Luigi Semenzato Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org Greetings MM experts, we (Chrome OS) are experiencing episodes of extremely sluggish interactive response, i.e. tens of seconds delay between an action (such as typing something) and the corresponding screen update during times of very fast allocation, while using zram. We can reproduce this by running a few processes that mmap large chunks of memory, then randomly touch pages to fault them in. We also think this happens when a process writes a large amount of data using buffered I/O, and the "Buffers" field in /proc/meminfo exceeds 1GB. (This is something that can and should be corrected by using unbuffered I/O instead, but it's a data point.) We're wondering if this problem has been noticed before and what folks do to ameliorate the situation. Specifically, is there any way to throttle the rate of allocation when the system is swapping? Thanks! Luigi -- 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: from psmtp.com (na3sys010amx172.postini.com [74.125.245.172]) by kanga.kvack.org (Postfix) with SMTP id 754986B0031 for ; Mon, 5 Aug 2013 14:24:41 -0400 (EDT) Message-ID: <51FFEDD6.7020906@intel.com> Date: Mon, 05 Aug 2013 11:24:22 -0700 From: Dave Hansen MIME-Version: 1.0 Subject: Re: swap behavior during fast allocation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Luigi Semenzato Cc: linux-mm@kvack.org On 08/05/2013 11:04 AM, Luigi Semenzato wrote: > We can reproduce this by running a few processes that mmap large > chunks of memory, then randomly touch pages to fault them in. We also > think this happens when a process writes a large amount of data using > buffered I/O, and the "Buffers" field in /proc/meminfo exceeds 1GB. > (This is something that can and should be corrected by using > unbuffered I/O instead, but it's a data point.) Where are all the buffers coming from? Most I/O to/from filesystems should be instantiating relatively modest amounts of Buffers. Are you doing I/O directly to devices for some reason? -- 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: from psmtp.com (na3sys010amx150.postini.com [74.125.245.150]) by kanga.kvack.org (Postfix) with SMTP id 44E076B0033 for ; Mon, 5 Aug 2013 14:30:51 -0400 (EDT) Received: by mail-oa0-f42.google.com with SMTP id i18so7107525oag.1 for ; Mon, 05 Aug 2013 11:30:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <51FFEDD6.7020906@intel.com> References: <51FFEDD6.7020906@intel.com> Date: Mon, 5 Aug 2013 11:30:50 -0700 Message-ID: Subject: Re: swap behavior during fast allocation From: Luigi Semenzato Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: linux-mm@kvack.org On Mon, Aug 5, 2013 at 11:24 AM, Dave Hansen wrote: > On 08/05/2013 11:04 AM, Luigi Semenzato wrote: >> We can reproduce this by running a few processes that mmap large >> chunks of memory, then randomly touch pages to fault them in. We also >> think this happens when a process writes a large amount of data using >> buffered I/O, and the "Buffers" field in /proc/meminfo exceeds 1GB. >> (This is something that can and should be corrected by using >> unbuffered I/O instead, but it's a data point.) > > Where are all the buffers coming from? Most I/O to/from filesystems > should be instantiating relatively modest amounts of Buffers. Are you > doing I/O directly to devices for some reason? Correct. This is the autoupdate process, which writes the changed kernel and filesystem blocks directly to raw partitions. (The filesystem partition is obviously not currently in use.) -- 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