From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756970AbdJQLlM (ORCPT ); Tue, 17 Oct 2017 07:41:12 -0400 Received: from ozlabs.org ([103.22.144.67]:42437 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852AbdJQLlK (ORCPT ); Tue, 17 Oct 2017 07:41:10 -0400 From: Michael Ellerman To: Michal Hocko , linux-mm@kvack.org Cc: Vlastimil Babka , Andrew Morton , KAMEZAWA Hiroyuki , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Igor Mammedov , Vitaly Kuznetsov , LKML , Michal Hocko Subject: Re: [PATCH 1/2] mm: drop migrate type checks from has_unmovable_pages In-Reply-To: <20171013120013.698-1-mhocko@kernel.org> References: <20171013115835.zaehapuucuzl2vlv@dhcp22.suse.cz> <20171013120013.698-1-mhocko@kernel.org> Date: Tue, 17 Oct 2017 22:41:08 +1100 Message-ID: <871sm2j92j.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko writes: > From: Michal Hocko > > Michael has noticed that the memory offline tries to migrate kernel code > pages when doing > echo 0 > /sys/devices/system/memory/memory0/online > > The current implementation will fail the operation after several failed > page migration attempts but we shouldn't even attempt to migrate > that memory and fail right away because this memory is clearly not > migrateable. This will become a real problem when we drop the retry loop > counter resp. timeout. > > The real problem is in has_unmovable_pages in fact. We should fail if > there are any non migrateable pages in the area. In orther to guarantee > that remove the migrate type checks because MIGRATE_MOVABLE is not > guaranteed to contain only migrateable pages. It is merely a heuristic. > Similarly MIGRATE_CMA does guarantee that the page allocator doesn't > allocate any non-migrateable pages from the block but CMA allocations > themselves are unlikely to migrateable. Therefore remove both checks. > > Reported-by: Michael Ellerman > Signed-off-by: Michal Hocko Thanks, that works for me. Tested-by: Michael Ellerman cheers From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id 350356B0069 for ; Tue, 17 Oct 2017 07:41:13 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id l24so1305713pgu.17 for ; Tue, 17 Oct 2017 04:41:13 -0700 (PDT) Received: from ozlabs.org (ozlabs.org. [2401:3900:2:1::2]) by mx.google.com with ESMTPS id h1si6062072pln.150.2017.10.17.04.41.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2017 04:41:12 -0700 (PDT) From: Michael Ellerman Subject: Re: [PATCH 1/2] mm: drop migrate type checks from has_unmovable_pages In-Reply-To: <20171013120013.698-1-mhocko@kernel.org> References: <20171013115835.zaehapuucuzl2vlv@dhcp22.suse.cz> <20171013120013.698-1-mhocko@kernel.org> Date: Tue, 17 Oct 2017 22:41:08 +1100 Message-ID: <871sm2j92j.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko , linux-mm@kvack.org Cc: Vlastimil Babka , Andrew Morton , KAMEZAWA Hiroyuki , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Igor Mammedov , Vitaly Kuznetsov , LKML , Michal Hocko Michal Hocko writes: > From: Michal Hocko > > Michael has noticed that the memory offline tries to migrate kernel code > pages when doing > echo 0 > /sys/devices/system/memory/memory0/online > > The current implementation will fail the operation after several failed > page migration attempts but we shouldn't even attempt to migrate > that memory and fail right away because this memory is clearly not > migrateable. This will become a real problem when we drop the retry loop > counter resp. timeout. > > The real problem is in has_unmovable_pages in fact. We should fail if > there are any non migrateable pages in the area. In orther to guarantee > that remove the migrate type checks because MIGRATE_MOVABLE is not > guaranteed to contain only migrateable pages. It is merely a heuristic. > Similarly MIGRATE_CMA does guarantee that the page allocator doesn't > allocate any non-migrateable pages from the block but CMA allocations > themselves are unlikely to migrateable. Therefore remove both checks. > > Reported-by: Michael Ellerman > Signed-off-by: Michal Hocko Thanks, that works for me. Tested-by: Michael Ellerman cheers -- 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