Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4290656ybb; Tue, 14 Apr 2020 04:29:00 -0700 (PDT) X-Google-Smtp-Source: APiQypLpCmaQPWG8ym/wcgugopTJcWTGiopz4UwZh8Y1wUbjCkcRzM60HSa39NbWFgoHueb6bkk4 X-Received: by 2002:a17:906:a390:: with SMTP id k16mr18852085ejz.219.1586863740731; Tue, 14 Apr 2020 04:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586863740; cv=none; d=google.com; s=arc-20160816; b=tAwYgWfFKwMWxfbddC56g/Z1oJzg4FF5fwC938CPtCPm9GzxNDltPIeLFJvsSYuNp4 LuMFtjVXAezBLCXtpafUjNFFMc4PycmTqSpCV7nvCDxykELE4icykilnTc5oWjZ1wbtz 4fuajLmOimKJ2TVho4OEUpC1sVAYYtFuNq2DFQL7KW7Wl/pvvkO3pWNoV9hENPttkSIp Y+NdoM7yNDTJtO1lAGrUv8skccR3Idqh0mgeB+NAYPg6ppQGEs3rLY+Dsi2jOjC+Vo8v Wg1ovOMKg9SNw7OYtYhqint3q/U8OBmp0Be3RJjZhnXFXzTkRXMFINS6v44q0QFkBmiE EP9A== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=r6TG4pNdkQ8bbRldQLJJamZzWipmPmxyS/0Y9lj13kw=; b=MxDK8xriLo8Lz4WpVTdknBuG/mFA+o+T3JQUv1vyz7+jlyqogUm9yv4N1IGsdkuj5Y xQ3x9i9z6y4Afm9XI+8KTWSj7i0yS2FxPMvFKxAYL75/Brm73jdJ2AyR3V06bJVHur+x 0KHtPuaCH8gGF90iFH3USttPjF/Atwq8YLxcSej7uqzEIIhIb7LX1EZJlH9u7AJJaSA6 5B9qbg0OLagZ/Ueeb8gLmvLYNN8s0R6684+1PSleyFzJn6akSsyewr4WfTLa5rZ0O7qe X7UTS5LqHfb3YWiy/1zz9RZFAu+U18alLsTMKUMl3b3KM4Lk0BmDv5b1zoEbEKF9SvGS ukrw== 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 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si4044139edr.342.2020.04.14.04.28.37; Tue, 14 Apr 2020 04:29:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729577AbgDMMw0 (ORCPT + 99 others); Mon, 13 Apr 2020 08:52:26 -0400 Received: from mga12.intel.com ([192.55.52.136]:52670 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728174AbgDMMwZ (ORCPT ); Mon, 13 Apr 2020 08:52:25 -0400 IronPort-SDR: Ua7wDtM//lN6TyRDR2rF/yhYfguyL6GK/xC5LT/8hIMcn1oyT+lF7qCrmuubLJGQ8OiNHydDdi +9bq3puhydoQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 05:52:24 -0700 IronPort-SDR: Lq4QaAwH4EgBZArwqec40Z/ctUZa6H/5OVIGS2gLNbJjK0L9MVK6hLmKn85d06sxaVRG8lBWDx WqqWdRnF58Kw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,378,1580803200"; d="scan'208";a="245132796" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 13 Apr 2020 05:52:22 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id B8E9EDE; Mon, 13 Apr 2020 15:52:21 +0300 (EEST) From: "Kirill A. Shutemov" To: akpm@linux-foundation.org, Andrea Arcangeli Cc: Zi Yan , Yang Shi , Ralph Campbell , John Hubbard , William Kucharski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv3, RESEND 0/8] thp/khugepaged improvements and CoW semantics Date: Mon, 13 Apr 2020 15:52:12 +0300 Message-Id: <20200413125220.663-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patchset adds khugepaged selftest (anon-THP only for now), expands cases khugepaged can handle and switches anon-THP copy-on-write handling to 4k. Please review and consider applying. v3: - Fix handling compound pages in swap cache; - Rework swaped vs. referenced check; - Fix refcounting for compound pages; - Drop Reviewed-by/Acked-by as patchset changed non-trivially; - Typos; v2: - Fix race in compound page handling; - Add one more test-case for compound page case; - Rework LRU add cache draining; - Typos; Kirill A. Shutemov (8): khugepaged: Add self test khugepaged: Do not stop collapse if less than half PTEs are referenced khugepaged: Drain all LRU caches before scanning pages khugepaged: Drain LRU add pagevec after swapin khugepaged: Allow to collapse a page shared across fork khugepaged: Allow to collapse PTE-mapped compound pages thp: Change CoW semantics for anon-THP khugepaged: Introduce 'max_ptes_shared' tunable Documentation/admin-guide/mm/transhuge.rst | 7 + include/trace/events/huge_memory.h | 3 +- mm/huge_memory.c | 249 +----- mm/khugepaged.c | 218 +++-- tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/khugepaged.c | 982 +++++++++++++++++++++ 6 files changed, 1174 insertions(+), 286 deletions(-) create mode 100644 tools/testing/selftests/vm/khugepaged.c -- 2.26.0