Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5134264imu; Tue, 8 Jan 2019 12:07:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN43nba3Gv/6zbaL9FThOo2wfkExPBwlkAZ2CO68ofSlYPYoC3StVv1qH6wKrvbhsrp3c0Vs X-Received: by 2002:a63:2bc4:: with SMTP id r187mr2723373pgr.306.1546978079781; Tue, 08 Jan 2019 12:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546978079; cv=none; d=google.com; s=arc-20160816; b=0an1JQ+rqAKQVcaeisBtNGUDrXmOqsk+QUp1DbESEKA45r4axia5yfo2UcFHmJJ7Tm 8Q7STX58Td0cQTZgVYtXHicxTy2j6FmdX1HQpcc/v6N1CCI9LlFeMYyT+RF35qKJft2T Sfi00dG+YhCMtvDdxisr8YDpTyboaOSuDd7vfds1b7jUN36RMI/kJahTuf4TbiCyYJhS VhF6OIUXj4X74tBnxKHS4CqLSGM3dZpbSuK0K/vuvBUxqRaW7eUYvrmvzA0tcB3X4uTz MTeUV+spA2GAMl9fqEricCoaof4JFTtp6eL48T780CUzF2N6KYaYqErjZxoj/aK50r6q 0glQ== 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=5BTK79gITn+7qktsv71y6FZVdcV6txp9i3mbGrFgA7g=; b=GrpQwWGgQ8FwzLgsrWfTpzdB0BlaZMTfSKHKb227QstQZ8UAUJORmDDDGuF2rjcD66 hWx5K5L/qmS753RIyo2NTaX4O1rG8RIEPuMNmcBmrYN8UGkOpfF4ySj4BqNnvp/CulNO v5kcl6UOfEczivahFtZq5kJ5/FYf0XHtd28mT2zjpdBHP21gHGehi2Fq411v5UdDue+n /15BRwk6lj/OMnejxt/5odv6FBrE+U0xtHPe8LZPwucb/0ff7QyFF1JR2stwskD3KyC9 iPBzSafcMvXWjVDOnw0MCmEE2czclWA0HD7Q56jYgDMsw1R13hniufhxeG6rWoIpwwPA xfvw== 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 w2si5903946pgh.565.2019.01.08.12.07.44; Tue, 08 Jan 2019 12:07:59 -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 S1730251AbfAHUEl (ORCPT + 99 others); Tue, 8 Jan 2019 15:04:41 -0500 Received: from mx2.suse.de ([195.135.220.15]:34722 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729043AbfAHUEj (ORCPT ); Tue, 8 Jan 2019 15:04:39 -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 AF595AEE7; Tue, 8 Jan 2019 20:04:37 +0000 (UTC) Date: Tue, 8 Jan 2019 21:04:36 +0100 From: Michal Hocko To: Alexander Duyck Cc: Arun KS , arunks.linux@gmail.com, akpm@linux-foundation.org, vbabka@suse.cz, osalvador@suse.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org, getarunks@gmail.com Subject: Re: [PATCH v7] mm/page_alloc.c: memory_hotplug: free pages as higher order Message-ID: <20190108200436.GK31793@dhcp22.suse.cz> References: <1546578076-31716-1-git-send-email-arunks@codeaurora.org> <37498672d5b2345b1435477e78251282af42742b.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37498672d5b2345b1435477e78251282af42742b.camel@linux.intel.com> 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 08-01-19 10:40:18, Alexander Duyck wrote: > On Fri, 2019-01-04 at 10:31 +0530, Arun KS wrote: > > When freeing pages are done with higher order, time spent on coalescing > > pages by buddy allocator can be reduced. With section size of 256MB, hot > > add latency of a single section shows improvement from 50-60 ms to less > > than 1 ms, hence improving the hot add latency by 60 times. Modify > > external providers of online callback to align with the change. > > > > Signed-off-by: Arun KS > > Acked-by: Michal Hocko > > Reviewed-by: Oscar Salvador > > After running into my initial issue I actually had a few more questions > about this patch. > > > [...] > > +static int online_pages_blocks(unsigned long start, unsigned long nr_pages) > > +{ > > + unsigned long end = start + nr_pages; > > + int order, ret, onlined_pages = 0; > > + > > + while (start < end) { > > + order = min(MAX_ORDER - 1, > > + get_order(PFN_PHYS(end) - PFN_PHYS(start))); > > + > > + ret = (*online_page_callback)(pfn_to_page(start), order); > > + if (!ret) > > + onlined_pages += (1UL << order); > > + else if (ret > 0) > > + onlined_pages += ret; > > + > > + start += (1UL << order); > > + } > > + return onlined_pages; > > } > > > > Should the limit for this really be MAX_ORDER - 1 or should it be > pageblock_order? In some cases this will be the same value, but I seem > to recall that for x86 MAX_ORDER can be several times larger than > pageblock_order. Does it make any difference when we are in fact trying to onine nr_pages and we clamp to it properly? > > static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages, > > void *arg) > > { > > - unsigned long i; > > unsigned long onlined_pages = *(unsigned long *)arg; > > - struct page *page; > > > > if (PageReserved(pfn_to_page(start_pfn))) > > I'm not sure we even really need this check. Getting back to the > discussion I have been having with Michal in regards to the need for > the DAX pages to not have the reserved bit cleared I was originally > wondering if we could replace this check with a call to > online_section_nr since the section shouldn't be online until we set > the bit below in online_mem_sections. > > However after doing some further digging it looks like this could > probably be dropped entirely since we only call this function from > online_pages and that function is only called by memory_block_action if > pages_correctly_probed returns true. However pages_correctly_probed > should return false if any of the sections contained in the page range > is already online. Yes you are right but I guess it would be better to address in a separate patch that deals with PageReserved manipulation in general. I do not think we want to remove the check silently. People who might be interested in backporting this for whatever reason might screatch their head why the test is not needed anymore. -- Michal Hocko SUSE Labs