Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp467433imu; Wed, 9 Jan 2019 00:31:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Zas/lF1m+ru2KIxzlebZlLfHy/fgfSQnIemWWbWuhJXqSWlq+ppZEnEqEJCPSlE3vLhse X-Received: by 2002:a62:34c6:: with SMTP id b189mr5159707pfa.229.1547022669361; Wed, 09 Jan 2019 00:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547022669; cv=none; d=google.com; s=arc-20160816; b=fRFc/rRFejrtKZijXQFS3YZOmrnbR56pE6ev4rY3IuaBsTWuyJYkxCChltvJGZhwdw KtM/o4MjDCzMop29LtFjwbuU5JsC0/++i3H3Cf8aIVtaoYCFAQSfnyd+aWA2GNIy4QBK jKLCse7usZ1hb/42PDEWnn4BaQ7t4YGKYa9/mrhU2/2i0st+zK+bERuBEACm7HoUDrwh fNsZO7ksNJrmXFqUuemjQzcNj2aCWsqLOT8k83hhB3yLcfiKsQbaVN3C3aBg7kAhUo9p E9JBUxj3uKXKpnE8osu0bIby08DAo0/9lrTguwsslGdNKbcYlF+eR3sBAAuOBdgKlJAF Yz8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=aNaPGcZWaIJiNSKOqIPFLBEUMZheEAwfT2I7L8u3R4w=; b=HkLfElnQmgWspdGuVe1qK+hdbGKL2Tki4z9CycZBL5AhDv8uJ4qICP+O8JK7kf6jvc N5Q36Gs/aRSMYib3GySNDGCa74lW1vLFx/wE4fzwPYNacaRC2MWgGONduTXVB+S6XA7W NZ2DgIf0oHoPyVg1pTQo4vzyRKMFF+MPfAjSe0MH0ssgiovN578F150xImzg2iCPbVVU VANw/i08m08fmzH7eoe5m77Qy7Z0NF6iB1hDBDWaxQmsT6RX+/cJgXeMZcj64211cpDs GmQ82/bjpet9LoAHaVhwxtwXrwmV/18bst+pc9lzJWYNCEf+6wQaGmc3cjpi2mhJcKHE 78JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Grxsnm9T; dkim=pass header.i=@codeaurora.org header.s=default header.b=cbSJ6Hks; 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 m33si67564431pgl.379.2019.01.09.00.30.53; Wed, 09 Jan 2019 00:31:09 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=Grxsnm9T; dkim=pass header.i=@codeaurora.org header.s=default header.b=cbSJ6Hks; 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 S1729909AbfAII2w (ORCPT + 99 others); Wed, 9 Jan 2019 03:28:52 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:47438 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729883AbfAII2v (ORCPT ); Wed, 9 Jan 2019 03:28:51 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3766C608CC; Wed, 9 Jan 2019 08:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547022531; bh=HAHZTo0hDNkUzVj/mxTCi95gzfkpBYMAyMODJB9bHKI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Grxsnm9TlDKUWm8z7OHktost43odRqygcSb+SoKWrbvMbMCBDdUJC88wf+y5/3Wi2 4EYK8TU9GRVZQny8Othod50i6rMolZBsadPQ3VZHEjgKnIxNjLiAejlaMtYXVFIlfD znx93hLos56dulZu6vqgaTBH5W0dpTOKNXsNseZ8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 2921C601D7; Wed, 9 Jan 2019 08:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547022530; bh=HAHZTo0hDNkUzVj/mxTCi95gzfkpBYMAyMODJB9bHKI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cbSJ6HksOkQd3tP9vHvcl1t8IeJ5wqj1sFG7b32cqosAFjBjVcq64mvW/sk3rHDjZ JeD6lXRV3fBcXzJYBXUprGj72jEfCX+ohjs5oibNm2++SHAjqPygfqLp4rymGQUmTS vpo1WjpdsED0VjpV4F+HXbqdMj6AbC87JxzJwbqI= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Jan 2019 13:58:50 +0530 From: Arun KS To: Michal Hocko Cc: Alexander Duyck , 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 In-Reply-To: <20190109073718.GM31793@dhcp22.suse.cz> References: <1546578076-31716-1-git-send-email-arunks@codeaurora.org> <20190108181352.GI31793@dhcp22.suse.cz> <20190109073718.GM31793@dhcp22.suse.cz> Message-ID: X-Sender: arunks@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-09 13:07, Michal Hocko wrote: > On Wed 09-01-19 11:28:52, Arun KS wrote: >> On 2019-01-08 23:43, Michal Hocko wrote: >> > On Tue 08-01-19 09:56:09, Alexander Duyck wrote: >> > > On Fri, 2019-01-04 at 10:31 +0530, Arun KS wrote: >> > [...] >> > > > 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))) >> > > > - for (i = 0; i < nr_pages; i++) { >> > > > - page = pfn_to_page(start_pfn + i); >> > > > - (*online_page_callback)(page); >> > > > - onlined_pages++; >> > > > - } >> > > > + onlined_pages = online_pages_blocks(start_pfn, nr_pages); >> > > >> > > Shouldn't this be a "+=" instead of an "="? It seems like you are >> > > going >> > > to lose your count otherwise. >> > >> > You are right of course. I should have noticed during the review. >> > Thanks! >> >> I think we don't need to. The caller function is setting onlined_pages >> = 0 >> before calling online_pages_range(). >> And there are no other reference to online_pages_range other than from >> online_pages(). > > Are you missing that we accumulate onlined_pages via > *(unsigned long *)arg = onlined_pages; > in online_pages_range? In my testing I didn't find any problem. To match the code being replaced and to avoid any corner cases, it is better to use += Will update the patch. Regards, Arun