Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218Ab2JVPLo (ORCPT ); Mon, 22 Oct 2012 11:11:44 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]:46535 "EHLO mail-oa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913Ab2JVPLm (ORCPT ); Mon, 22 Oct 2012 11:11:42 -0400 MIME-Version: 1.0 In-Reply-To: <5082305A.2050108@cn.fujitsu.com> References: <506C0AE8.40702@jp.fujitsu.com> <506C0C53.60205@jp.fujitsu.com> <50727984.20401@cn.fujitsu.com> <507E77D1.3030709@cn.fujitsu.com> <508118A6.80804@cn.fujitsu.com> <5082305A.2050108@cn.fujitsu.com> From: KOSAKI Motohiro Date: Mon, 22 Oct 2012 11:11:20 -0400 X-Google-Sender-Auth: E7qlaMp79GzVPD8wf5caKb2mahw Message-ID: Subject: Re: [PATCH 1/4] acpi,memory-hotplug : add memory offline code to acpi_memory_device_remove() To: Wen Congyang Cc: Yasuaki Ishimatsu , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, rientjes@google.com, liuj97@gmail.com, len.brown@intel.com, cl@linux.com, minchan.kim@gmail.com, akpm@linux-foundation.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1210 Lines: 29 >> ?? >> If resource was not allocated a driver, a driver doesn't need to >> deallocate it when >> error path. I haven't caught your point. >> > > REMOVAL_NORMAL can be in 2 cases: > 1. error path. If init call fails, we don't call it. We call this function > only when something fails after init. > 2. unbind the device from the driver. > If we don't offline and remove memory when unbinding the device from the driver, > the device may be out of control. When we eject this driver, we don't offline and Memory never be out of control by driver unloading. It is controled from kernel core. It is an exception from regular linux driver model. > remove it, but we will eject and poweroff the device. It is very dangerous because > the kernel uses the memory but we poweroff it. > > acpi_bus_hot_remove_device() > acpi_bus_trim() // this function successes because the device has no driver > _PS3 // poweroff > _EJ0 // eject -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/