Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1204191imm; Wed, 11 Jul 2018 20:04:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfp4A/0ejPtJ1Xt1AawJ38KOfFooEJ4TjJl86ZsmnAOHQVPMzDGrtMuufWlAPc5vcFgvDqg X-Received: by 2002:a65:6211:: with SMTP id d17-v6mr453904pgv.450.1531364696709; Wed, 11 Jul 2018 20:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364696; cv=none; d=google.com; s=arc-20160816; b=XUOSlPck5QX6eAm9d5rApFG9OF5ftQPy+H8PPU2JFxUr2eHo24+AbItfjzD1IJASju SZ2CZtwA5QxwPK5rKp3yXZR1GUMdqu0kdsQOh5+lzNR9ksE+utmowCOBB+g36geFP2Ca 7VQznNRz/UN0rbXiOvSketQu+G0Mvd1kcuKL+z8oT5S2lmVlmMHrrX9HothziW+RUezJ +oe2TsdQGAvNnmjwNoAXJsdj5ZC9ct0DXi7yGp4Yl+rYixBWG6TdO5XaIgNJdbhHN2IQ Ndr//cyKxulBbIcsNBXDUpME6btZFdILLQ26GXg2lmIoSxo13wqE/nD7etee+uIZDT/1 JT9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=N5azZuKOvdXlUlxpNrFNQuBM36Ipb0K3vkXlM8aN8Ic=; b=pTbJaWv59qgadmDJMQVlm39+TD8i948Ek4mXYVh7YwxGDrObzvRo/ZRIu2iIVV6nKq Gwjtyv6pgJTeO6j4bR2d/QgdZeTZQBRHSaSsFb1+xHN3KTCCgvYTeuVO0pZlqoZQw9ep XLT5IFHzyISyHb/zSTmpPsmhuID9JD/yVpaDTS6TKHOVXWyI1CA8DzHiwbu1haNH3ySa SfSGcDHJYqfc4korpYnxGZWoJPxBfDNRN66Br5V8YKzv3PQrxPc64P/BldgWv6pZqFnS yyEUE44eJ4oBvAkMUk7Vu8IgQKCL0HmWn1WQxEppNrliQ1/vXSY8yd60Z2DawAJCh5xJ 5FTA== 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 z23-v6si20664114pfh.266.2018.07.11.20.04.41; Wed, 11 Jul 2018 20:04:56 -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 S2390734AbeGKXRH (ORCPT + 99 others); Wed, 11 Jul 2018 19:17:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46854 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732281AbeGKXRH (ORCPT ); Wed, 11 Jul 2018 19:17:07 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 343E5DB6; Wed, 11 Jul 2018 23:10:31 +0000 (UTC) Date: Wed, 11 Jul 2018 16:10:30 -0700 From: Andrew Morton To: David Rientjes Cc: Linus Torvalds , Davidlohr Bueso , Alexey Dobriyan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, vmacache: hash addresses based on pmd Message-Id: <20180711161030.b5ae2f5b1210150c13b1a832@linux-foundation.org> In-Reply-To: References: <20180709180841.ebfb6cf70bd8dc08b269c0d9@linux-foundation.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Jul 2018 18:37:37 -0700 (PDT) David Rientjes wrote: > > Did you consider LRU-sorting the array instead? > > > > It adds 40 bytes to struct task_struct, What does? LRU sort? It's a 4-entry array, just do it in place, like bh_lru_install(). Confused. > but I'm not sure the least > recently used is the first preferred check. If I do > madvise(MADV_DONTNEED) from a malloc implementation where I don't control > what is free()'d and I'm constantly freeing back to the same hugepages, > for example, I may always get first slot cache hits with this patch as > opposed to the 25% chance that the current implementation has (and perhaps > an lru would as well). > > I'm sure that I could construct a workload where LRU would be better and > could show that the added footprint were worthwhile, but I could also > construct a workload where the current implementation based on pfn would > outperform all of these. It simply turns out that on the user-controlled > workloads that I was profiling that hashing based on pmd was the win. That leaves us nowhere to go. Zapping the WARN_ON seems a no-brainer though?