From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbdJKLRR (ORCPT ); Wed, 11 Oct 2017 07:17:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:32981 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbdJKLRQ (ORCPT ); Wed, 11 Oct 2017 07:17:16 -0400 Subject: Re: [PATCH 1/2] mm, memory_hotplug: do not fail offlining too early To: Michal Hocko Cc: Michael Ellerman , Andrew Morton , KAMEZAWA Hiroyuki , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Igor Mammedov , Vitaly Kuznetsov , linux-mm@kvack.org, LKML References: <20170918070834.13083-1-mhocko@kernel.org> <20170918070834.13083-2-mhocko@kernel.org> <87bmlfw6mj.fsf@concordia.ellerman.id.au> <20171010122726.6jrfdzkscwge6gez@dhcp22.suse.cz> <87infmz9xd.fsf@concordia.ellerman.id.au> <20171011065123.e7jvoftmtso3vcha@dhcp22.suse.cz> <20171011081317.b2cdnhjdyzgdo3up@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Wed, 11 Oct 2017 13:17:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171011081317.b2cdnhjdyzgdo3up@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/2017 10:13 AM, Michal Hocko wrote: > On Wed 11-10-17 10:04:39, Vlastimil Babka wrote: >> On 10/11/2017 08:51 AM, Michal Hocko wrote: > [...] >>> This is really strange! As you write in other email the page is >>> reserved. That means that some of the earlier checks >>> if (zone_idx(zone) == ZONE_MOVABLE) >>> return false; >>> mt = get_pageblock_migratetype(page); >>> if (mt == MIGRATE_MOVABLE || is_migrate_cma(mt)) >> >> The MIGRATE_MOVABLE check is indeed bogus, because that doesn't >> guarantee there are no unmovable pages in the block (CMA block OTOH >> should be a guarantee). > > OK, thanks for confirmation. I will remove the MIGRATE_MOVABLE check > here. Do you think it is worth removing CMA check as well? This is > merely an optimization AFAIU because we do not have to check the full > pageblockworth of pfns. Actually, we should remove the CMA part as well. It's true that MIGRATE_CMA does guarantee that the *buddy allocator* won't allocate non-MOVABLE pages from the pageblock. But if the memory got allocated as an actual CMA allocation (alloc_contig...) it will almost certainly not be movable. > Anyway, let's way for Michael to confirm it really helps. If yes I will > post a full patch and ask Andrew to add it as a prerequisite for this > patch when sending to Linus to prevent the regression. > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 9FB766B0260 for ; Wed, 11 Oct 2017 07:17:18 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id z80so4001739pff.1 for ; Wed, 11 Oct 2017 04:17:18 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id w187si10955349pfb.175.2017.10.11.04.17.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 11 Oct 2017 04:17:17 -0700 (PDT) Subject: Re: [PATCH 1/2] mm, memory_hotplug: do not fail offlining too early References: <20170918070834.13083-1-mhocko@kernel.org> <20170918070834.13083-2-mhocko@kernel.org> <87bmlfw6mj.fsf@concordia.ellerman.id.au> <20171010122726.6jrfdzkscwge6gez@dhcp22.suse.cz> <87infmz9xd.fsf@concordia.ellerman.id.au> <20171011065123.e7jvoftmtso3vcha@dhcp22.suse.cz> <20171011081317.b2cdnhjdyzgdo3up@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Wed, 11 Oct 2017 13:17:13 +0200 MIME-Version: 1.0 In-Reply-To: <20171011081317.b2cdnhjdyzgdo3up@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Michael Ellerman , Andrew Morton , KAMEZAWA Hiroyuki , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Igor Mammedov , Vitaly Kuznetsov , linux-mm@kvack.org, LKML On 10/11/2017 10:13 AM, Michal Hocko wrote: > On Wed 11-10-17 10:04:39, Vlastimil Babka wrote: >> On 10/11/2017 08:51 AM, Michal Hocko wrote: > [...] >>> This is really strange! As you write in other email the page is >>> reserved. That means that some of the earlier checks >>> if (zone_idx(zone) == ZONE_MOVABLE) >>> return false; >>> mt = get_pageblock_migratetype(page); >>> if (mt == MIGRATE_MOVABLE || is_migrate_cma(mt)) >> >> The MIGRATE_MOVABLE check is indeed bogus, because that doesn't >> guarantee there are no unmovable pages in the block (CMA block OTOH >> should be a guarantee). > > OK, thanks for confirmation. I will remove the MIGRATE_MOVABLE check > here. Do you think it is worth removing CMA check as well? This is > merely an optimization AFAIU because we do not have to check the full > pageblockworth of pfns. Actually, we should remove the CMA part as well. It's true that MIGRATE_CMA does guarantee that the *buddy allocator* won't allocate non-MOVABLE pages from the pageblock. But if the memory got allocated as an actual CMA allocation (alloc_contig...) it will almost certainly not be movable. > Anyway, let's way for Michael to confirm it really helps. If yes I will > post a full patch and ask Andrew to add it as a prerequisite for this > patch when sending to Linus to prevent the regression. > -- 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