Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3177466imm; Thu, 17 May 2018 04:48:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpxV5UPgi4MR9ylHDEuhMNWqnmwaHa5CbmA18LmoRfSydCyCeRe5i4lyQhr4GobA9YmABGW X-Received: by 2002:a62:dc4e:: with SMTP id t75-v6mr4859373pfg.139.1526557729079; Thu, 17 May 2018 04:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526557729; cv=none; d=google.com; s=arc-20160816; b=jeKZV7EU1oz7ZSnmBGLwNE9yxJ8FzoSxVoYaVdsOn2MDb+MemKoDDNcK+56gWiwGcB PmbHm5SlNvZzhP6rsEBLQqz6dTXDr9jHchn+/O7RqlR8iRI9oyPUO3WWtyjIRWjhJV/b b6zgUnUKc4d5dFY04Tp50olzhbfNnT7IxR4ahWkJ9Eh1hXQR6ssbzAbSzu3KJExiJqGk m+pKl0yXKsfCJ6zH2lVJTcc8d84CEkQXKwvYEVpJH9U+ky7eG4ERKXHWuJlZka5vQRSq hyWEmHnOI71/eV4l7rUtgRp0mFvFZmh8H0pUq91ExQDFDmHSJqAytgTPIx8wYwfQLD+4 qafA== 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:dkim-signature:arc-authentication-results; bh=FFmVmY40tUdwMTNxtRsQT+9vPimuRj6MlgJYeTm/gGQ=; b=nVAZ1JW4SSL17buRqQXux+WTLEFkmTIBtbOpxNh99/ZuQMCtxD+K8f7WN65DWOdbjQ UaAarK6wtdwcd51VUmirN0+71yeyBOzMXy9/qfpROcL0Hc8XFCrktrkTXO0ITh7ZNwkC IMlbGAHwltkmv4IBZdUtY8dSQQEguNkxUZ7vUrTOpwJ7FhoMlLKYmMBC+OPIecQZKk5C VkrB4htHd3VMY0hzRiQM7fhIvdw9Em5WXfV3koAVIUqJr+X9U2FyxSyv5wFmnatmh0dG 7iUWdNyFhb2Hxt+3kyRKPVkZq/35daaBLgPSWL++dBXPtjwTO8Vog1VtvE+uDUG/+aWa KJrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FMRbqlkt; 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 n16-v6si4001842pgc.205.2018.05.17.04.48.33; Thu, 17 May 2018 04:48:49 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FMRbqlkt; 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 S1751647AbeEQLsY (ORCPT + 99 others); Thu, 17 May 2018 07:48:24 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51022 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbeEQLsX (ORCPT ); Thu, 17 May 2018 07:48:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FFmVmY40tUdwMTNxtRsQT+9vPimuRj6MlgJYeTm/gGQ=; b=FMRbqlkt8UvnrtyG63ocg+KpZ 8bcTQev+k19nT+zognU6OfuiiQo6s/QZNYf0ZnBJRzr+GfRUzDKL2Cu5J0az/lNvNzT5fYi81bBL8 sAIOf5yf5FSXIpYEy5S2FBregYZ4MB2M+nIS/WqOgEzC1jU9IkCfXcCePmUBihmwrJk50UyPyzvJ0 hhwgo1oAgfbLyOAqpCoJ1BUmhuXW5LmOfEC8WzRaTDh2kZ9OgyhEcvYO8B/f5ZnT8dsb6YgenhvAz UZshhbJkns+H9dhxRoRd+XUmddvuzrFYG0vEPXc4mzOp8XoEjC2Zd4QCQEkyzb6DEU5OY2LlseMlC 4Nfl+6ckA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJHOP-0001KW-Il; Thu, 17 May 2018 11:48:21 +0000 Date: Thu, 17 May 2018 04:48:21 -0700 From: Matthew Wilcox To: Aaron Lu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Huang Ying , Dave Hansen , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Vlastimil Babka , Mel Gorman , Daniel Jordan , Tariq Toukan Subject: Re: [RFC v3 PATCH 1/5] mm/page_alloc: use helper functions to add/remove a page to/from buddy Message-ID: <20180517114821.GA26689@bombadil.infradead.org> References: <20180509085450.3524-1-aaron.lu@intel.com> <20180509085450.3524-2-aaron.lu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509085450.3524-2-aaron.lu@intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 09, 2018 at 04:54:46PM +0800, Aaron Lu wrote: > +static inline void add_to_buddy_head(struct page *page, struct zone *zone, > + unsigned int order, int mt) > +{ > + add_to_buddy_common(page, zone, order); > + list_add(&page->lru, &zone->free_area[order].free_list[mt]); > +} Isn't this function (and all of its friends) misnamed? We're not adding this page to the buddy allocator, we're adding it to the freelist. It doesn't go to the buddy allocator until later, if at all.