Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp118946imm; Wed, 5 Sep 2018 22:43:19 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdak1ynxcEoSMndJ04+g3YyRtywtHdIgSMqqE0msTHr0MIBCzt+oxBRuWzKwXDYrzrVfYnwG X-Received: by 2002:a63:6604:: with SMTP id a4-v6mr1129871pgc.404.1536212599048; Wed, 05 Sep 2018 22:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536212599; cv=none; d=google.com; s=arc-20160816; b=NQKd9BXIceCxx4Gjtf+Rd9MHW9i7khT0kbCLNF9N4zgqY1OIvAG4N4+e3aABA9LujM gqUqaaKD1OdLCGazNuxoIWJoR9rOcDfAp9XwWGdKq/aqz7Wjg0HNpdfLGeDY/mW0cOON CjSdA6OLHQmnw15VhPPwM3LPfznuBD67BiFVlEC/jTcqpG8h2Mb78iXg7nn1jvOAQuUZ 8s6AdpW2g2YRz86YFDm0HK9Z8Rs2WyMUlG4ZjNC83LzZ8e7pCNNldD1bkbi7wT/cHr+7 aLFVwjWtQkkSeEqlBh11QSp+tkGdjjEEPn4yVy5pjJPcw/+lDvuOdSF9r2qKgMvUgQ6O uJhQ== 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=zav2TZ+OKrRQdIKN5XvBPN+uRsrRmlz9RTcP6GsD2sU=; b=JDF641lhjAX2JaCx3Jd7Qkz0gWNvfKg6kYfknZqQzK8GBJExl4NDE29daavo/RLjFI GQRcWt18Jb2HnygjlEj1OSaaqLmolsOe6NcQHJVeCw9FLN7YFGP6OBynbXetU0qbStt6 IireJZ0JWIZkQSptYc/jl+jImQ3OmnsCzX1LChscJnEqLnSTr3Y3wxg+7a2Y4jYTMKow m0penOsCKz0F5jRj6B4ih6ig5Xjka6HyluV9GFCcPM9SYdfc5prh5COxnnDIyHj7wj0R rCUj4IiK81Mpe1VM488OlHYE2SaBU+VjEAyMMcLgw8etXlME7b5TCalBrJ+PjTYdF1NC 81nA== 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 3-v6si4123382plv.314.2018.09.05.22.43.03; Wed, 05 Sep 2018 22:43:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726161AbeIFKPn (ORCPT + 99 others); Thu, 6 Sep 2018 06:15:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:45420 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725850AbeIFKPn (ORCPT ); Thu, 6 Sep 2018 06:15:43 -0400 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 0D7DBADA9; Thu, 6 Sep 2018 05:41:58 +0000 (UTC) Date: Thu, 6 Sep 2018 07:41:57 +0200 From: Michal Hocko To: Alexander Duyck Cc: linux-mm , LKML , "Duyck, Alexander H" , pavel.tatashin@microsoft.com, Andrew Morton , Ingo Molnar , "Kirill A. Shutemov" Subject: Re: [PATCH 2/2] mm: Create non-atomic version of SetPageReserved for init use Message-ID: <20180906054157.GI14951@dhcp22.suse.cz> References: <20180904181550.4416.50701.stgit@localhost.localdomain> <20180904183345.4416.76515.stgit@localhost.localdomain> <20180905062428.GV14951@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed 05-09-18 13:18:24, Alexander Duyck wrote: > On Tue, Sep 4, 2018 at 11:24 PM Michal Hocko wrote: > > > > On Tue 04-09-18 11:33:45, Alexander Duyck wrote: > > > From: Alexander Duyck > > > > > > It doesn't make much sense to use the atomic SetPageReserved at init time > > > when we are using memset to clear the memory and manipulating the page > > > flags via simple "&=" and "|=" operations in __init_single_page. > > > > > > This patch adds a non-atomic version __SetPageReserved that can be used > > > during page init and shows about a 10% improvement in initialization times > > > on the systems I have available for testing. > > > > I agree with Dave about a comment is due. I am also quite surprised that > > this leads to such a large improvement. Could you be more specific about > > your test and machines you were testing on? > > So my test case has been just initializing 4 3TB blocks of persistent > memory with a few trace_printk values added to track total time in > move_pfn_range_to_zone. > > What I have been seeing is that the time needed for the call drops on > average from 35-36 seconds down to around 31-32. This information belongs to the changelog. > > > Other than that the patch makes sense to me. > > > > > Signed-off-by: Alexander Duyck > > > > With the above addressed, feel free to add > > Acked-by: Michal Hocko > > > > Thanks! > > As far as adding a comment are we just talking about why it is > reserved, or do we need a description of the __SetPageReserved versus > SetPageReserved. For now I was looking at adding a comment like: the later. The reason why we make it reserved should be quite clear. A comment wouldn't hurt of course and what you have is a good start. But it is usually atomic vs. non-atomic SetPage$Foo which needs some clarification. > @@ -5517,8 +5517,13 @@ void __meminit memmap_init_zone(unsigned long > size, int nid, unsigned long zone, > not_early: > page = pfn_to_page(pfn); > __init_single_page(page, pfn, zone, nid); > + > + /* > + * Mark page reserved as it will need to wait for onlining > + * phase for it to be fully associated with a zone. > + */ > if (context == MEMMAP_HOTPLUG) > - SetPageReserved(page); > + __SetPageReserved(page); > > /* > * Mark the block movable so that blocks are reserved for > > Any thoughts on this? > > Thanks. > > - Alex -- Michal Hocko SUSE Labs