From patchwork Tue Apr 18 15:28:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13215819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC22AC77B7E for ; Tue, 18 Apr 2023 15:30:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjDRPai (ORCPT ); Tue, 18 Apr 2023 11:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbjDRPaf (ORCPT ); Tue, 18 Apr 2023 11:30:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66702E71 for ; Tue, 18 Apr 2023 08:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681831742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xy2baqViLPQFaV+ePofs2RF21rT4D1RwTBQ+hV2mFL0=; b=USrxZzoio94HayaYP5cNGQ/7gKvog+lIgI25NjUiJwNb37EeJDAOMINxjocwcsoq+TPvDg zWI5t+PDwK+vfTMO2aiWNg1FOZaLIYd9ejhK0CL+gKyMhiNKrKVSXqy9JjYtfYkHZg+YrG hp4CUIWKtec+sG/OVYFzyqOJSVcM5mk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-1Y5Vri3MOPCaoatnNYVwXg-1; Tue, 18 Apr 2023 11:28:56 -0400 X-MC-Unique: 1Y5Vri3MOPCaoatnNYVwXg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12B78889059; Tue, 18 Apr 2023 15:28:54 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.194.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7EB914152F6; Tue, 18 Apr 2023 15:28:50 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, David Hildenbrand , Andrew Morton , Stefan Roesch , Rik van Riel , Johannes Weiner , Michal Hocko , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Heiko Carstens , Vasily Gorbik , Sven Schnelle , Shuah Khan Subject: [PATCH v1 0/3] mm/ksm: improve PR_SET_MEMORY_MERGE=0 handling and cleanup disabling KSM Date: Tue, 18 Apr 2023 17:28:46 +0200 Message-Id: <20230418152849.505124-1-david@redhat.com> In-Reply-To: <20230418051342.1919757-1-shr@devkernel.io> References: <20230418051342.1919757-1-shr@devkernel.io> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org This is a follow-up to [1]: [PATCH v9 0/3] mm: process/cgroup ksm support which is not in mm-unstable yet (but soon? :) ). I'll be on vacation for ~2 weeks, so sending it out now as reply to [1]. (1) Make PR_SET_MEMORY_MERGE=0 unmerge pages like setting MADV_UNMERGEABLE does, (2) add a selftest for it and (3) factor out disabling of KSM from s390/gmap code. Cc: Andrew Morton Cc: Stefan Roesch Cc: Rik van Riel Cc: Johannes Weiner Cc: Michal Hocko Cc: Christian Borntraeger Cc: Janosch Frank Cc: Claudio Imbrenda Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Sven Schnelle Cc: Andrew Morton Cc: Shuah Khan [1] https://lkml.kernel.org/r/20230418051342.1919757-1-shr@devkernel.io David Hildenbrand (3): mm/ksm: unmerge and clear VM_MERGEABLE when setting PR_SET_MEMORY_MERGE=0 selftests/ksm: ksm_functional_tests: add prctl unmerge test mm/ksm: move disabling KSM from s390/gmap code to KSM code arch/s390/mm/gmap.c | 20 +------ include/linux/ksm.h | 7 +++ kernel/sys.c | 7 +-- mm/ksm.c | 58 +++++++++++++++++++ .../selftests/mm/ksm_functional_tests.c | 46 +++++++++++++-- 5 files changed, 107 insertions(+), 31 deletions(-)