Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5082923imu; Tue, 8 Jan 2019 11:10:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN7H+h/metew2mPEW2FP/yOW34ZRUBVzPLqJkbjRVIiuR8+3kYQU5LXCWC02V9A+qviAyXaw X-Received: by 2002:a62:1d8f:: with SMTP id d137mr2899616pfd.11.1546974606243; Tue, 08 Jan 2019 11:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546974606; cv=none; d=google.com; s=arc-20160816; b=qhCRrFFAmvNGTRbvixxH58XrDJhn44beWx1nDDeLBpUEB3iQ47MXQIzQVw9OXBfxLM 7BhjQCsCAEGoRAnEy8fhaTSTl+m0fUVnGVNKhebP74xv8x8ajSM7BODwUelQyqK/9AJF gzps0LhL0MsvzDPUYGK+kDeFyHcA1J40qvXmPVA5jMyyTvIds+D1/3KJdgu3eIMXnNZv j9wXIXS/R1yiUyh5td9F11w9CJ2peLcnqXxrSNqrgnr8lAMnf8zcDqcE72zK5jwONGTo aLw/HK/RC/Et6NUO2TZ8HmbWu+ets97X4mpuVjKfxi2G5Kfdc3ASZerVw8skkU4AAGjZ u4Tw== 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=hg5qgf40Nb1NYz305xVLEIz7aKFlFBwVGPhp4J3jdNE=; b=JubvUGjavJv2HrTiiOPnafRaoxL7bFLVllqiCnE9IKhF66RNqubisdcB4rW4r3ZZAj /bcv9e4uXaTElkTCdelVuxRK5RAAVUC6XiE2jIrXCnQREzyWzotZ6v14asLisQGE2awu rmvACHSxZiQfpm/7xEbq+OjpbpmPTz0ZiG8FqBNGAK/3eOV+YR/14M7lYFIEiiLiCbG8 4h7PPrCQUkBJzhQ0VL7GQF9Wpy2Z7nhyWHwbDWO385i0F4CSGhJpgdW0uI8T23W24Hm/ qkUsNYL4Q91y15yI+RarSnTV0s7es4GR4oQEXT06Mxnz2D4DaPafFlhbj4qFEXbW6jTI 5eUw== 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 s4si49175577pga.377.2019.01.08.11.09.50; Tue, 08 Jan 2019 11:10:06 -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 S1729416AbfAHSNz (ORCPT + 99 others); Tue, 8 Jan 2019 13:13:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:39142 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727484AbfAHSNz (ORCPT ); Tue, 8 Jan 2019 13:13:55 -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 CAF0EAD00; Tue, 8 Jan 2019 18:13:53 +0000 (UTC) Date: Tue, 8 Jan 2019 19:13:52 +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: <20190108181352.GI31793@dhcp22.suse.cz> References: <1546578076-31716-1-git-send-email-arunks@codeaurora.org> 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 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! -- Michal Hocko SUSE Labs