Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933613AbdCJTBJ (ORCPT ); Fri, 10 Mar 2017 14:01:09 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56911 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933818AbdCJTAt (ORCPT ); Fri, 10 Mar 2017 14:00:49 -0500 Date: Fri, 10 Mar 2017 13:00:37 -0600 From: Reza Arbab To: Michal Hocko Cc: Igor Mammedov , Heiko Carstens , Vitaly Kuznetsov , linux-mm@kvack.org, Andrew Morton , Greg KH , "K. Y. Srinivasan" , David Rientjes , Daniel Kiper , linux-api@vger.kernel.org, LKML , linux-s390@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, qiuxishi@huawei.com, toshi.kani@hpe.com, xieyisheng1@huawei.com, slaoub@gmail.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, Zhang Zhen , Yasuaki Ishimatsu , Tang Chen Subject: Re: WTH is going on with memory hotplug sysf interface (was: Re: [RFC PATCH] mm, hotplug: get rid of auto_online_blocks) References: <1488462828-174523-1-git-send-email-imammedo@redhat.com> <20170302142816.GK1404@dhcp22.suse.cz> <20170302180315.78975d4b@nial.brq.redhat.com> <20170303082723.GB31499@dhcp22.suse.cz> <20170303183422.6358ee8f@nial.brq.redhat.com> <20170306145417.GG27953@dhcp22.suse.cz> <20170307134004.58343e14@nial.brq.redhat.com> <20170309125400.GI11592@dhcp22.suse.cz> <20170310135807.GI3753@dhcp22.suse.cz> <20170310155333.GN3753@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170310155333.GN3753@dhcp22.suse.cz> Organization: IBM Linux Technology Center User-Agent: NeoMutt/20170306 (1.8.0) X-TM-AS-GCONF: 00 x-cbid: 17031019-0052-0000-0000-000001981338 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006758; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00832773; UDB=6.00408725; IPR=6.00610361; BA=6.00005202; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014598; XFM=3.00000013; UTC=2017-03-10 19:00:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031019-0053-0000-0000-00004F02771D Message-Id: <20170310190037.fifahjd47joim6zy@arbab-laptop> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-10_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703100148 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 919 Lines: 25 On Fri, Mar 10, 2017 at 04:53:33PM +0100, Michal Hocko wrote: >OK, so while I was playing with this setup some more I probably got why >this is done this way. All new memblocks are added to the zone Normal >where they are accounted as spanned but not present. It's not always zone Normal. See zone_for_memory(). This leads to a workaround for having to do online_movable in descending block order. Instead of this: 1. probe block 34, probe block 33, probe block 32, ... 2. online_movable 34, online_movable 33, online_movable 32, ... you can online_movable the first block before adding the rest: 1. probe block 32, online_movable 32 2. probe block 33, probe block 34, ... - zone_for_memory() will cause these to start Movable 3. online 33, online 34, ... - they're already in Movable, so online_movable is equivalentr I agree with your general sentiment that this stuff is very nonintuitive. -- Reza Arbab