Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp643554ybi; Fri, 21 Jun 2019 05:53:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwCqVbgnj/ArcvxXuS8ACPzOJ0hvRpmM2zZlN6Y6F/wbw6zOX+cgP1feTSaPVWvH0vfQC2 X-Received: by 2002:a17:90a:9f0b:: with SMTP id n11mr6342208pjp.98.1561121611969; Fri, 21 Jun 2019 05:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561121611; cv=none; d=google.com; s=arc-20160816; b=vgtzWRKrxZ2xqG09lw7CIRXX6SHjd2dFSlkuEEtVmWxVKEvbobmU14i6OGefvyIywD aEsd8uGjsParCS9BBvCRVINstnQaFtTebLIZzqO3ypGtLybZb4w+qR+bpy/oBWxZwUOx XhMMGoM9qZpUcxM/SQL2wrvkZRbECXghw+XBH9Ac2fB+9B621vw682iWZFVLkEWnYEFQ BhDpMOimjXf26UNFhZusxecFNJ3xAa3VqIBS3KHAAXZXdfzgA4aaeQD6gXpdCxnPTkAo ACZnmcBuyoCfrJJkhcb+kHAVCZbBIg7nEA/Vfhfq5+fAuQhYEtmQOUXhqRbNnh6gCKyJ Suqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=K+0w3Eo7dJoAJgrQlXhVbE5fbECg9yu1TJLNsUCu8t4=; b=br+IMXJRbJg0+Ba0fsuOGpQ6TqkQwkSp/upznWYpG2E9c1MlVYanARZoS8Unc9JtPX oeXdY4XxOliT5qhrHZqnpI2xjMmyDg+/X30NzxFUowmQ68AG4iosau3LG5SAwf14TZBG BTQPaVSmnk8Ma8HLBcLdyH58XDJX+NYV8M5ZoYJPdCyxCtyc+785X4TSg4/AcW/+2Su+ 1MnJ2DhZtwxYf5hBtMMms3ViZC+9o49m8lrWa/tw7tBgqjlGjz+ZdwXMoXWrdnk1oyxj 22CJDdWUY7LHQQiHpN49dfl+s3UsWGyjySlaXRMCFaDvB6mMdt1fc5s4xho2Ue/26/KQ Ftvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cp18si2580003plb.287.2019.06.21.05.53.16; Fri, 21 Jun 2019 05:53:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbfFUMxG (ORCPT + 99 others); Fri, 21 Jun 2019 08:53:06 -0400 Received: from foss.arm.com ([217.140.110.172]:59926 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726299AbfFUMxF (ORCPT ); Fri, 21 Jun 2019 08:53:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0978E142F; Fri, 21 Jun 2019 05:53:05 -0700 (PDT) Received: from [10.162.42.140] (p8cg001049571a15.blr.arm.com [10.162.42.140]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 158133F718; Fri, 21 Jun 2019 05:52:59 -0700 (PDT) Subject: Re: [PATCH V6 3/3] arm64/mm: Enable memory hot remove To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, catalin.marinas@arm.com, will.deacon@arm.com Cc: mark.rutland@arm.com, mhocko@suse.com, ira.weiny@intel.com, david@redhat.com, cai@lca.pw, logang@deltatee.com, james.morse@arm.com, cpandya@codeaurora.org, arunks@codeaurora.org, dan.j.williams@intel.com, mgorman@techsingularity.net, osalvador@suse.de, ard.biesheuvel@arm.com, steve.capper@arm.com References: <1560917860-26169-1-git-send-email-anshuman.khandual@arm.com> <1560917860-26169-4-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: Date: Fri, 21 Jun 2019 18:23:22 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1560917860-26169-4-git-send-email-anshuman.khandual@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/19/2019 09:47 AM, Anshuman Khandual wrote: > +#ifdef CONFIG_MEMORY_HOTPLUG > + /* > + * FIXME: We should have called remove_pagetable(start, end, true). > + * vmemmap and vmalloc virtual range might share intermediate kernel > + * page table entries. Removing vmemmap range page table pages here > + * can potentially conflict with a cuncurrent vmalloc() allocation. > + * > + * This is primarily because valloc() does not take init_mm ptl for > + * the entire page table walk and it's modification. Instead it just > + * takes the lock while allocating and installing page table pages > + * via [p4d|pud|pmd|pte]_aloc(). A cuncurrently vanishing page table > + * entry via memory hotremove can cause vmalloc() kernel page table > + * walk pointers to be invalid on the fly which can cause corruption > + * or worst, a crash. There are couple of typos above which I will fix along with other reviews.