Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp649605img; Tue, 26 Feb 2019 06:24:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IY7/oj3i7o2nV8Ddo0c7TYA5TrMZwbL/6jDxJe3GQmOoYYDGlFxp/dGVTuEqxcssmnwy9wS X-Received: by 2002:a17:902:748b:: with SMTP id h11mr26055823pll.334.1551191078032; Tue, 26 Feb 2019 06:24:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551191078; cv=none; d=google.com; s=arc-20160816; b=A+zT1TTxp4LFkRUhqd2asCLJSuVvDSIGzFlaXLkG3z7nugq8cWTExmVVcbnChqvXCg CeRU6klnw4o+MPh0WYRyB+OW4AnfFX5vQH2r2IurGgrpxBzH1h5zi0uZZlhJpFgAL3Wr UCKS9/vmtCUs4/g3QWcf/OgjPkrJvUyZwcHnolsalF6xHilbCYxYJH4cbAc08VBe/ULk E4C7y7DuZWIts52i9ETwuYBrlq8gI45lCO0qQkDP2gzA3Y3ESeLunDF8s7fonW0afBFT fclLgIQ3ajeJtu4G52QJAe+1gpVUOQ6VDnqkVzasOyTyisMsEjXD0JiBUmZgGnwL+L5q EkJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZsulBu4UyrGv/4rwZYd+rWNfPfV9R07nVJEG+I8XMNk=; b=Va29r3AYpxhnGqu5TuFjS6NxdqfWfB8rdLDtDAmOjR2MEK4bB8oVjfkj3t1IbF7AFj BBQH/8D2Z79s12GEeEs0u4fS/gRv7dEnaAPLfkxHTMXyiUdmtJ5jGCW0ctmcJvgnUhVC MABGyihwbFlXYN8mdIUOZv4fuW1oylYHgc3PJuMJrxu8Y8BBfrehAvCw3r/avJSW0ZJs 6EHOGxkYP0Fd/val0215wWyGaDFFC1DPd2WBdz2R2tEiQXhicvA5WMP6umc1dobdInGB l9Olar3VkfpjB8+wZk1KReWW1cxYLARCAgDq0VMyd98miBN8KGWoyBepVsMiTdWsbxru 96eQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 127si12478497pgf.307.2019.02.26.06.24.21; Tue, 26 Feb 2019 06:24:38 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727203AbfBZOXy (ORCPT + 99 others); Tue, 26 Feb 2019 09:23:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:34748 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726099AbfBZOXx (ORCPT ); Tue, 26 Feb 2019 09:23:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id AAD46AF57; Tue, 26 Feb 2019 14:23:52 +0000 (UTC) Date: Tue, 26 Feb 2019 15:23:52 +0100 From: Michal Hocko To: Qian Cai Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC Message-ID: <20190226142352.GC10588@dhcp22.suse.cz> References: <20190225191710.48131-1-cai@lca.pw> <20190226123521.GZ10588@dhcp22.suse.cz> <4d4d3140-6d83-6d22-efdb-370351023aea@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d4d3140-6d83-6d22-efdb-370351023aea@lca.pw> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 26-02-19 09:16:30, Qian Cai wrote: > > > On 2/26/19 7:35 AM, Michal Hocko wrote: > > On Mon 25-02-19 14:17:10, Qian Cai wrote: > >> When onlining memory pages, it calls kernel_unmap_linear_page(), > >> However, it does not call kernel_map_linear_page() while offlining > >> memory pages. As the result, it triggers a panic below while onlining on > >> ppc64le as it checks if the pages are mapped before unmapping, > >> Therefore, let it call kernel_map_linear_page() when setting all pages > >> as reserved. > > > > This really begs for much more explanation. All the pages should be > > unmapped as they get freed AFAIR. So why do we need a special handing > > here when this path only offlines free pages? > > > > It sounds like this is exact the point to explain the imbalance. When offlining, > every page has already been unmapped and marked reserved. When onlining, it > tries to free those reserved pages via __online_page_free(). Since those pages > are order 0, it goes free_unref_page() which in-turn call > kernel_unmap_linear_page() again without been mapped first. How is this any different from an initial page being freed to the allocator during the boot? -- Michal Hocko SUSE Labs