Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2629095rdb; Fri, 22 Sep 2023 04:31:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8pc8UlEL1sgaZD7XEIJF/6WSLu8CwzJE6FfKZimo8HhKHe2F/oQqhJ8ol2HWcTjuh7+gh X-Received: by 2002:a9d:7849:0:b0:6b9:9288:613c with SMTP id c9-20020a9d7849000000b006b99288613cmr8496499otm.13.1695382293953; Fri, 22 Sep 2023 04:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695382293; cv=none; d=google.com; s=arc-20160816; b=uwfX/4CV+50cLS8HY8FD6mDr7qTtXMVr2u6nkDREdz+n+BmiuCOUdt4RciEJY/mBgB YAEPxOWou88WMaqAO/KZ9MksU3f6l2Le7T/tT86jmwz9aEcIJ8OaAG5S/WxWvwCG5YNA sj9KJvfU0E3XgPInNwkTU4W3ZenWEvOkGWpDxaagR6vRJPSnira5IQRP1JY6PVSy7VRR csmfIc4xDyPw0VRpnUKjzWpV/cZR6UgLo6Q5bmun65o2r4/lD6N54Q5b/6opp87A+ork R0nWmoQMf1SuoPi1MooBlCpg7oYsXQowrDA5yIxImIJQ9d5u1DXROSTwVX1jFHvFwevV eNfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=SIhGRQ+jq+1Km2F1qvwwSuWSmdnSiAFLUvntzhDvpyg=; fh=7nEcp/ZBXXSL20W3T3mpC1aHVeo5VJfcICz/byPCLCY=; b=yC9+uquJsd6V1JTGVPm9dHzpEO/psdXgt79PauXz+MReVJTto23qAlU3vihHubP10g lmdlmqOCXicOoAJ7u1QogoYCHKBhtRyFtSYH2taTxSy4niuVsrM1iTJ9Ufs0i6LhzUcH xPcZXMSfXLIlQrJKhkpq8TE8xKG9rRZYlBT2MT2FSL/gKhqFOYGtdxGHhM62SQvMFTqY jmvqzO+gds6eOYyjCcxZAC6K2kTGcNLv+LK5hHtgAzBYbQo5Q7bsGs7cnUlzjlrrQURT bVVPn+1PumLKjtySkZHLd9EDCYRU6K1xuJU5f22i25yGkdtPP9lRn6rpEtg8xmLLNkmj 70Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IL14HIDW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f20-20020a637554000000b0057790a5a8e7si3715971pgn.190.2023.09.22.04.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 04:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IL14HIDW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 43D2782A0BD5; Thu, 21 Sep 2023 17:41:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229542AbjIVAlG (ORCPT + 99 others); Thu, 21 Sep 2023 20:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjIVAlF (ORCPT ); Thu, 21 Sep 2023 20:41:05 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78929F5 for ; Thu, 21 Sep 2023 17:41:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0EAAC433CA; Fri, 22 Sep 2023 00:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1695342773; bh=A+v01Q6QfPOT5GvSCgfxalz/bjawMm8CUUKFpuPhXtQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IL14HIDWESUt2Qml3tdEpv1jobiReIc/d141sl+CBb8zQTIbl7HHTNqjzPfdxee+f NF08oFI5iX6RcYrE9P7RJh82ZHqVEpaiVKB2SiriNUv8x7ouLx8JKf+10wErg7tc21 CFdltrsAfsxsSVFZ+OvmbaNl9WrAOcKCT3ORXwFY= Date: Thu, 21 Sep 2023 17:32:51 -0700 From: Andrew Morton To: Stefan Roesch Cc: kernel-team@fb.com, david@redhat.com, hannes@cmpxchg.org, riel@surriel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 0/2] mm/ksm: add fork-exec support for prctl Message-Id: <20230921173251.54b854fb0ec7af2bf3e3ec3b@linux-foundation.org> In-Reply-To: <20230921164709.3627565-1-shr@devkernel.io> References: <20230921164709.3627565-1-shr@devkernel.io> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 17:41:08 -0700 (PDT) On Thu, 21 Sep 2023 09:47:07 -0700 Stefan Roesch wrote: > A process can enable KSM with the prctl system call. When the process is > forked the KSM flag is inherited by the child process. I guess that's logical, as it's still the same program. > However if the > process is executing an exec system call directly after the fork, the > KSM setting is cleared. This patch series addresses this problem. Well... who said it's a problem? There's nothing in our documentation about this(?). Why is the current behavior wrong? If the new program wants KSM, it can turn on KSM. This significant change in user-visible behavior deserves much more explanation and justification, please. Including an explanation of why it's OK to change kernel behavior under existing users' feet like this,