From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754695Ab3AGN52 (ORCPT ); Mon, 7 Jan 2013 08:57:28 -0500 Received: from cantor2.suse.de ([195.135.220.15]:34296 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754090Ab3AGN51 (ORCPT ); Mon, 7 Jan 2013 08:57:27 -0500 Date: Mon, 7 Jan 2013 13:57:21 +0000 From: Mel Gorman To: Jason Liu Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, riel@redhat.com, minchan@kernel.org, kamezawa.hiroyu@jp.fujitsu.com, linux-mm@kvack.org Subject: Re: [PATCH] mm: compaction: fix echo 1 > compact_memory return error issue Message-ID: <20130107135721.GD3885@suse.de> References: <1357458273-28558-1-git-send-email-r64343@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1357458273-28558-1-git-send-email-r64343@freescale.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 06, 2013 at 03:44:33PM +0800, Jason Liu wrote: > when run the folloing command under shell, it will return error > sh/$ echo 1 > /proc/sys/vm/compact_memory > sh/$ sh: write error: Bad address > > After strace, I found the following log: > ... > write(1, "1\n", 2) = 3 > write(1, "", 4294967295) = -1 EFAULT (Bad address) > write(2, "echo: write error: Bad address\n", 31echo: write error: Bad address > ) = 31 > > This tells system return 3(COMPACT_COMPLETE) after write data to compact_memory. > > The fix is to make the system just return 0 instead 3(COMPACT_COMPLETE) from > sysctl_compaction_handler after compaction_nodes finished. > > Suggested-by:David Rientjes > Cc:Mel Gorman > Cc:Andrew Morton > Cc:Rik van Riel > Cc:Minchan Kim > Cc:KAMEZAWA Hiroyuki > Signed-off-by: Jason Liu Acked-by: Mel Gorman -- Mel Gorman SUSE Labs