From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28684C2BA19 for ; Tue, 14 Apr 2020 12:15:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDF6E20732 for ; Tue, 14 Apr 2020 12:15:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YPCaSFzn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDF6E20732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7960D8E0003; Tue, 14 Apr 2020 08:15:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71E278E0001; Tue, 14 Apr 2020 08:15:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60D258E0003; Tue, 14 Apr 2020 08:15:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 42C0B8E0001 for ; Tue, 14 Apr 2020 08:15:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EAF5C248E for ; Tue, 14 Apr 2020 12:15:18 +0000 (UTC) X-FDA: 76706355516.29.shape34_4b7643d88fb13 X-HE-Tag: shape34_4b7643d88fb13 X-Filterd-Recvd-Size: 4998 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 12:15:18 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id g32so5911053pgb.6 for ; Tue, 14 Apr 2020 05:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=WHNX39DWF5Hlf3u8CwKDc+Fsn/bhcoFrdGg2YrrvOo0=; b=YPCaSFzn0oIdss6PgqWqExMDv2Ya4MqFKlIMtqX30ds70r7RnGgcscEiuorDHOmIxt bkg/vokkN/rRhBD6LJ9mw3mjhOahMg1Uwg9Qx2UNZFWTj0IMg9WnUDxB+ULJSCbA1ldn KSpVK42kxhB9z/aw0NH4UBeJI+KqGuxcHQoEPZCHcqOEDmAKdAwLZgWjuAma+5C/4TbG JmUnZp5MHDPoBd4ygsIhvDZ8ijEsX/e2wJi1VmDzroDN1oJ8TnkuqyUyr4ayZCZKIFK0 GcKo9BxipK0dpFhF+pZwLrt75E6HD72Q17JUhc4ZADldaZQrqxB3dU1lD6phiCSp3nG2 3WbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=WHNX39DWF5Hlf3u8CwKDc+Fsn/bhcoFrdGg2YrrvOo0=; b=GsyHdObLfOFQXebThh3DZ6EIVdTmLadcGkuYBPsvBC6uTMe7K3ZTKwMfHIXbSSUU4e HtaD+RHLCHU2OTZvkFskzsNngPTg5TlSxsXfeN+kemUprcc3Vnyfy68laemtmkwJNn42 cnqC7ZQPQBoGeI4wgXfX1VcdwWjRQN5aehHlsb2uPfPJbNyrp2g3TNbMZCIvR1/727WH CLK+FHhQwSrR0eb0PKvHfyx5eJT1lNb12mlBtXYVqmBC0fidqDvwCsR+Z3mGK5bdwI9a lpSEyBgukT1r9zKUtEvIoNHkHm3X4bJyU3WeTXrCNOyDwHuGkeWWrcAwaNFowfI+RsQr iWEw== X-Gm-Message-State: AGi0PuZRrxL0M6xXRsYrUu1uX7zNR/zaK3NmQGpuevX9ra7sFsuJgrlI qjXm2uA6rgAfn3XRVQ6kSoM= X-Google-Smtp-Source: APiQypIal3O38c4Mqwm4P9dpr8g1+GmgXzDHXceCqIscl9w/plzTRFxfjFtpP2vU89kIf2d05y9VAA== X-Received: by 2002:a63:1820:: with SMTP id y32mr11205009pgl.182.1586866517492; Tue, 14 Apr 2020 05:15:17 -0700 (PDT) Received: from localhost ([203.18.28.220]) by smtp.gmail.com with ESMTPSA id h11sm10999819pfn.125.2020.04.14.05.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 05:15:16 -0700 (PDT) Date: Tue, 14 Apr 2020 22:13:44 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings To: Christoph Hellwig Cc: Borislav Petkov , Catalin Marinas , "H. Peter Anvin" , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , Thomas Gleixner , Will Deacon , x86@kernel.org References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-5-npiggin@gmail.com> <20200414072316.GA5503@infradead.org> In-Reply-To: <20200414072316.GA5503@infradead.org> MIME-Version: 1.0 Message-Id: <1586864403.0qfilei2ft.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Excerpts from Christoph Hellwig's message of April 14, 2020 5:23 pm: > On Mon, Apr 13, 2020 at 10:53:03PM +1000, Nicholas Piggin wrote: >> For platforms that define HAVE_ARCH_HUGE_VMAP and support PMD vmap mappi= ngs, >> have vmalloc attempt to allocate PMD-sized pages first, before falling b= ack >> to small pages. Allocations which use something other than PAGE_KERNEL >> protections are not permitted to use huge pages yet, not all callers exp= ect >> this (e.g., module allocations vs strict module rwx). >>=20 >> This gives a 6x reduction in dTLB misses for a `git diff` (of linux), fr= om >> 45600 to 6500 and a 2.2% reduction in cycles on a 2-node POWER9. >>=20 >> This can result in more internal fragmentation and memory overhead for a >> given allocation. It can also cause greater NUMA unbalance on hashdist >> allocations. >>=20 >> There may be other callers that expect small pages under vmalloc but use >> PAGE_KERNEL, I'm not sure if it's feasible to catch them all. An >> alternative would be a new function or flag which enables large mappings= , >> and use that in callers. >=20 > Why do we even use vmalloc in this case rather than just doing a huge > page allocation? Which case? Usually the answer would be because you don't want to use contiguous physical memory and/or you don't want to use the linear=20 mapping. > What callers are you intersted in? The dentry and inode caches for this test, obviously. Lots of other things could possibly benefit though, other system=20 hashes like networking, but lot of other vmalloc callers that might benefit right away, some others could use some work to batch up allocation sizes to benefit. Thanks, Nick