Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4473299imm; Mon, 15 Oct 2018 15:45:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ShX40vFic/w1N3zbza2v16L87EQVGuo+QIZPILJ8lznvv7DHEI5n0GCAtFt5EfgtnikDy X-Received: by 2002:a63:d10b:: with SMTP id k11-v6mr17937105pgg.80.1539643508571; Mon, 15 Oct 2018 15:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539643508; cv=none; d=google.com; s=arc-20160816; b=vpUPZahtA6hUWSANsNRa6thIcBi39C0fz1CxJPn1QtK5+MMCAmSo7REy2k6kXsSGEt xhXUcIgG+csp3l53+JcWXZEMGpokjs7SnsiKhqvFpO4Qs1Sv8jqvAfpwYMupz7X1Sk6a l2zqnnXsRM6UhNdBkBAjcwTkUxY7mAuvyZH5gCaVCHKrxSWGg1ga0o+crO1MTndzTP+4 SWcisx8gPrlMYAej0Do7vp+acym/Rim+gKA/Pszt+S5Gbd9kkD3S4CLVvdBC5iMjR4zT rsGqNeh6lBXN36vUM79d93lMkuOwcHa3cII2gUtXurS/k8ZooZEMKKK6vwsMoQLCpvan dLOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=lcdA8vzlGdBRSt/wgdDNhQdeFjyLTuB6dzeroL/ctY8=; b=JPhbNjUHZ7i5ADMqDE4x3x8OhJxVseRfeOO4UNxv5pE6gpQ/45lAY95EhFONnB7lb2 rnFpSXpAu+4pgvfj2OYCXYPIg6goi5UIltyqN2W0M5jGd4Net9iUhLASEwGsUdOkt+Vk YzVkRh9ZZ78mfiag0fH/BX7A0tI3Ccp1t55910tECzlxX0S1auFidbzLnvigRd/Uhh4u 6mW+uAur4Ncx2AzipieJX1kp4GG1/dH0wwnf3yPEWC3f00j5nbeP1D3oGHww1iiAiDMA jO4DPs7goVmLZgBAI2UTPJ+x3QjxbO4kRguRjCvIArnrZo+Pw+CylFB0HI4HDfseryHb 0rwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=Cg+VUp0F; 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 x186-v6si12379603pfx.19.2018.10.15.15.44.52; Mon, 15 Oct 2018 15:45:08 -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=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=Cg+VUp0F; 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 S1727139AbeJPG37 (ORCPT + 99 others); Tue, 16 Oct 2018 02:29:59 -0400 Received: from a9-99.smtp-out.amazonses.com ([54.240.9.99]:38974 "EHLO a9-99.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbeJPG37 (ORCPT ); Tue, 16 Oct 2018 02:29:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1539643362; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=fxwTb3fk5HcRMMz3gZbp/wY+XTqd89yTalFzAi/JmD0=; b=Cg+VUp0FPr6jerpxJQImbd5IpH1gPZRFZ/Tdha8pDJtH3OUtdBr/QZ58WZfYtzJM 6D2Ps5mGx/6fgrjKqOljf1DgwN5nbw4/IfViHgU8LKPDiWZZA2O28Ir/AllxkFE3P7B RDs/3r3EgUet5RdrnvTBEvImsxIi9RnfD/g/YIAk= Date: Mon, 15 Oct 2018 22:42:42 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: David Rientjes cc: Pekka Enberg , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch] mm, slab: avoid high-order slab pages when it does not reduce waste In-Reply-To: Message-ID: <0100016679e54c6e-67ca8716-c95e-427f-aec9-a5bee5e84792-000000@email.amazonses.com> References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.10.15-54.240.9.99 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Oct 2018, David Rientjes wrote: > @@ -1803,6 +1804,20 @@ static size_t calculate_slab_order(struct kmem_cache *cachep, > */ > if (left_over * 8 <= (PAGE_SIZE << gfporder)) > break; > + > + /* > + * If a higher gfporder would not reduce internal fragmentation, > + * no need to continue. The preference is to keep gfporder as > + * small as possible so slab allocations can be served from > + * MIGRATE_UNMOVABLE pcp lists to avoid stranding. > + */ I think either go for order 0 (because then you can use the pcp lists) or go as high as possible (then you can allocator larger memory areas with a single pass through the page allocator). But then I am not sure that the whole approach will do any good.