Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4471384imm; Mon, 15 Oct 2018 15:42:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV62B9e3U0bZO0MER9uCvtXBExR5oF1hxhdk1pAh5GyrrOfsya4BIjroN+SpEaHvmcUfJPhDz X-Received: by 2002:a65:52c1:: with SMTP id z1-v6mr17509151pgp.65.1539643339150; Mon, 15 Oct 2018 15:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539643339; cv=none; d=google.com; s=arc-20160816; b=zhB5jqDkVJktEekAnnWgHpm4mz6BH2yXZskFeriIWqCibYkFqUgeS0FsUV0+rxqxJs ZeYPvE3EIqfTrNuM1VHhrMLiCY27EFEr7PvHu38RPtBW5TbtoX8rPIXtvHKZGzI8woh2 +y3w32hs7igkRuuTPlAgEST/+40YhXy4OFbkFfK2xfAeidrQLaIH2DFuthuqsisf5HxO Xd7B9AnA8MyGbnllO+fiArsanXVeNmjA+ixbDk9vvOAhnMxkJ8caBFP4KfMqRyP/y0qb l8BAy1taRZv60o3BE92vpMoyeiV7lvMeoyDsv9T54CEDdhEvmAf1oMC6uBE3R0gEBigJ F6gA== 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=/nOjpW4xHi5vkgldZNZBuMaIuO+q/xvZ3b/arTT3PUY=; b=FIqYp4Zf567kQLJEzb2AJmLbwciDTsBQSPyyNhY+QjoutagnTuEbcjenXQumoj92B2 Ej0nh6h7EAya2+G3MA8KWGeaaX67OyBaIUWcrjEPnkNFj+vAKABVlbwb605iAADPmKlO Xcvi3yvthkibYQ7X+IydsOyumuHHWie7/GUwdAT0GJ+Sm93tG4zKpJDY7tWVHSWunP8u ZgPYP5TQsPh9RZ4vnslEglwzDRfLagD1qonotFtq0WSNS764KGRvlGxnxvhcY+Em+TK2 OROQj9vKLN1eFA9YW3Ii0iF5yKdKg+eaok1fzSHGNzKwenurFRGP+pAW8QvH0Me8AFKU xVpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=J5k3y8Ju; 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 e13-v6si12368078pfb.174.2018.10.15.15.42.02; Mon, 15 Oct 2018 15:42:19 -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=J5k3y8Ju; 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 S1726967AbeJPG2U (ORCPT + 99 others); Tue, 16 Oct 2018 02:28:20 -0400 Received: from a9-54.smtp-out.amazonses.com ([54.240.9.54]:47404 "EHLO a9-54.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbeJPG2U (ORCPT ); Tue, 16 Oct 2018 02:28:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1539643263; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=/NWRkm6PUxqN230FlS/SDuydCxSv361vgdrxuJLoTLQ=; b=J5k3y8JuzcKDs+XcVtidq0Aam+O6U/NajDXWOX6m/XJjfSLPZAEMbgDE6InTlh0j ZdttSP9wTwHe8/9FEb69kc3GUTAYBGHimRGPzogeFfJUZYVWFA2SoaL1IK6hnUf7QUF xSDkSmZxc8ArLbE6d7asPB5lu79MSz/W7upxWm2M= Date: Mon, 15 Oct 2018 22:41:03 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Andrew Morton cc: David Rientjes , Pekka Enberg , Joonsoo Kim , 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: <20181012151341.286cd91321cdda9b6bde4de9@linux-foundation.org> Message-ID: <0100016679e3c96f-c78df4e2-9ab8-48db-8796-271c4b439f16-000000@email.amazonses.com> References: <20181012151341.286cd91321cdda9b6bde4de9@linux-foundation.org> 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.54 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, Andrew Morton wrote: > > If the amount of waste is the same at higher cachep->gfporder values, > > there is no significant benefit to allocating higher order memory. There > > will be fewer calls to the page allocator, but each call will require > > zone->lock and finding the page of best fit from the per-zone free areas. There is a benefit because the management overhead is halved. > > Instead, it is better to allocate order-0 memory if possible so that pages > > can be returned from the per-cpu pagesets (pcp). Have a benchmark that shows this? > > > There are two reasons to prefer this over allocating high order memory: > > > > - allocating from the pcp lists does not require a per-zone lock, and > > > > - this reduces stranding of MIGRATE_UNMOVABLE pageblocks on pcp lists > > that increases slab fragmentation across a zone. The slab allocators generally buffer pages from the page allocator to avoid this effect given the slowness of page allocator operations anyways. > Confused. Higher-order slab pages never go through the pcp lists, do > they? I'd have thought that by tending to increase the amount of > order-0 pages which are used by slab, such stranding would be > *increased*? Potentially. > > We are particularly interested in the second point to eliminate cases > > where all other pages on a pageblock are movable (or free) and fallback to > > pageblocks of other migratetypes from the per-zone free areas causes > > high-order slab memory to be allocated from them rather than from free > > MIGRATE_UNMOVABLE pages on the pcp. Well does this actually do some good?