From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030857AbdAIXZh (ORCPT ); Mon, 9 Jan 2017 18:25:37 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45970 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030373AbdAIXZg (ORCPT ); Mon, 9 Jan 2017 18:25:36 -0500 Date: Mon, 9 Jan 2017 15:27:03 -0800 From: Andrew Morton To: Yasuaki Ishimatsu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, isimatu.yasuaki@jp.fujitsu.com, Reza Arbab Subject: Re: [PATCH v2] memory_hotplug: zone_can_shift() returns boolean value Message-Id: <20170109152703.4dd336106200d55d8f4deafb@linux-foundation.org> In-Reply-To: <2f9c3837-33d7-b6e5-59c0-6ca4372b2d84@gmail.com> References: <2f9c3837-33d7-b6e5-59c0-6ca4372b2d84@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Dec 2016 15:29:49 -0500 Yasuaki Ishimatsu wrote: > online_{kernel|movable} is used to change the memory zone to > ZONE_{NORMAL|MOVABLE} and online the memory. > > To check that memory zone can be changed, zone_can_shift() is used. > Currently the function returns minus integer value, plus integer > value and 0. When the function returns minus or plus integer value, > it means that the memory zone can be changed to ZONE_{NORNAL|MOVABLE}. > > But when the function returns 0, there is 2 meanings. > > One of the meanings is that the memory zone does not need to be changed. > For example, when memory is in ZONE_NORMAL and onlined by online_kernel > the memory zone does not need to be changed. > > Another meaning is that the memory zone cannot be changed. When memory > is in ZONE_NORMAL and onlined by online_movable, the memory zone may > not be changed to ZONE_MOVALBE due to memory online limitation(see > Documentation/memory-hotplug.txt). In this case, memory must not be > onlined. > > The patch changes the return type of zone_can_shift() so that memory > is not onlined when memory zone cannot be changed. What are the user-visible runtime effects of this fix? Please always include this info when fixing bugs - it is required so that others can decide which kernel version(s) need the fix. Thanks.