Received: by 10.213.65.68 with SMTP id h4csp975780imn; Sun, 25 Mar 2018 20:06:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx49mAXZ5Ks9+zu6i5rHruxzCYZQ47Xrvb+K/IQdDgcHUdy/N0kiixfAwu00ylzvKQltwYvO2 X-Received: by 10.98.68.86 with SMTP id r83mr314760pfa.145.1522033618132; Sun, 25 Mar 2018 20:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522033618; cv=none; d=google.com; s=arc-20160816; b=YfilXtxJiK3tp3YDc0ROP7mj305KrNp1WEMLHyOSaLMjz78+mK+1X/wj2snP/m6Urt INYJOv+8Poj0tSJe1mbjljsU1qAmY1MnzqWCqbDlMHhk4QZ8aIlwP9CSDhg/xXIs1nH6 tQDf8FebleMSXLX4CURiO2OIpTotr7sjMIxS7gsTDZwxOvisVe1xwFDywcpLOIzN0ihi uGa8zM8PRc6WxCBLyigRPZ1jJYPHJ9kkjb+j0lk/sKRxg5QBH9mvxBNJWVr/kDhqYaAi 96SkLMRYVBunOJuSQtgZZpFUi9QqHlO8laOBY0lnfU4dNPI62QHLHoFY7LQbLkYsNLaF JKpA== 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:arc-authentication-results; bh=F4/srSvmjVfk4SYTNobLq2xhlHG7AzofLL2VpYmd+eU=; b=EpVp34lFpaF82Hj5Mmb9ReqUu+19CWh6wIfvY///4id8XxTtA+lEH/rGkYOle9YxeC 1DQl1oZuol8BrMjrSBgxNHvC9vIidHEdcY1KPSZshu3WzR0/UG68Sy9kq82F+rnK9Len VgYKsBFqFtSK/dMjSk085ZQ0ofXSWwotg7hF1PpaNeF2qn3AO0vSwNdSuT6cuxjYCxET zMen6waZi3vG/fDGZyr1W61QAbvBCOz3VP4g3AutxabKo1HRG0POePxPWPMBjd28WXhp OgmOaTuClDGZ40y4FydSeGzyju89ytPiNEQ/95q1LZevtjAUajyabLUeqhZnv0t0uDk/ 6Owg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i63si9575040pge.289.2018.03.25.20.06.43; Sun, 25 Mar 2018 20:06:58 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbeCZDCr (ORCPT + 99 others); Sun, 25 Mar 2018 23:02:47 -0400 Received: from mga07.intel.com ([134.134.136.100]:19598 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbeCZDCq (ORCPT ); Sun, 25 Mar 2018 23:02:46 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2018 20:02:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,363,1517904000"; d="scan'208";a="45249143" Received: from aaronlu.sh.intel.com (HELO intel.com) ([10.239.159.135]) by orsmga002.jf.intel.com with ESMTP; 25 Mar 2018 20:02:42 -0700 Date: Mon, 26 Mar 2018 11:03:45 +0800 From: Aaron Lu To: Matthew Wilcox Cc: Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Huang Ying , Dave Hansen , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Mel Gorman , David Rientjes Subject: Re: [PATCH v4 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free Message-ID: <20180326030344.GA30075@intel.com> References: <20180301062845.26038-1-aaron.lu@intel.com> <20180301062845.26038-3-aaron.lu@intel.com> <9cad642d-9fe5-b2c3-456c-279065c32337@suse.cz> <20180313033453.GB13782@intel.com> <20180322151719.GA28468@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180322151719.GA28468@bombadil.infradead.org> 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 Thu, Mar 22, 2018 at 08:17:19AM -0700, Matthew Wilcox wrote: > On Tue, Mar 13, 2018 at 11:34:53AM +0800, Aaron Lu wrote: > > I wish there is a data structure that has the flexibility of list while > > at the same time we can locate the Nth element in the list without the > > need to iterate. That's what I'm looking for when developing clustered > > allocation for order 0 pages. In the end, I had to use another place to > > record where the Nth element is. I hope to send out v2 of that RFC > > series soon but I'm still collecting data for it. I would appreciate if > > people could take a look then :-) > > Sorry, I missed this. There is such a data structure -- the IDR, or > possibly a bare radix tree, or we can build a better data structure on > top of the radix tree (I talked about one called the XQueue a while ago). > > The IDR will automatically grow to whatever needed size, it stores > pointers, you can find out quickly where the last allocated index is, > you can remove from the middle of the array. Disadvantage is that it > requires memory allocation to store the array of pointers, *but* it > can always hold at least one entry. So if you have no memory, you can > always return the one element in your IDR to the free pool and allocate > from that page. Thanks for the pointer, will take a look later. Currently I'm focusing on finding real workloads that have zone lock contention issue.