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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAD0AC433FE for ; Fri, 30 Sep 2022 22:27:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F16FF6B0072; Fri, 30 Sep 2022 18:27:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC6866B0073; Fri, 30 Sep 2022 18:27:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8EFA8D0001; Fri, 30 Sep 2022 18:27:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CAE576B0072 for ; Fri, 30 Sep 2022 18:27:46 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9ACD680371 for ; Fri, 30 Sep 2022 22:27:46 +0000 (UTC) X-FDA: 79970190132.16.7AA2A03 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 299851A0015 for ; Fri, 30 Sep 2022 22:27:44 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A06E621C5; Fri, 30 Sep 2022 22:27:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F7A7C433D6; Fri, 30 Sep 2022 22:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1664576863; bh=wbj2EuyuEfvvCPmCnhQhRcLiTuG3KqDQW8nUblaU46I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vevH6DP6eJDGLbbSOjYy9HCIsdOjsg4vu76xXuLdFPG4XdAW14lLKqq1XrNqNkaz0 80lWnHQdv27Ov3zvp+keNsZVJiGdRl1RW364qdAKsJXdTL8fTj1Cw43emxXvqWbtod QYunY7aH7OvGMxSb9s3/pdrW2UDP18BHA2NUmRU4= Date: Fri, 30 Sep 2022 15:27:42 -0700 From: Andrew Morton To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Shuah Khan , Hugh Dickins , Vlastimil Babka , Peter Xu , Andrea Arcangeli , "Matthew Wilcox (Oracle)" , Jason Gunthorpe , John Hubbard Subject: Re: [PATCH v1 4/7] mm/ksm: fix KSM COW breaking with userfaultfd-wp via FAULT_FLAG_UNSHARE Message-Id: <20220930152742.55ee9c25b89ba483ec211be8@linux-foundation.org> In-Reply-To: <20220930141931.174362-5-david@redhat.com> References: <20220930141931.174362-1-david@redhat.com> <20220930141931.174362-5-david@redhat.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664576865; a=rsa-sha256; cv=none; b=akSdlTNp1//fWfw8y0rcUEw7wwCaw7V/4AAwMXxTkf+D1yBEunBYE9as1HncZVHgnzR/Y7 JED6PiMac+tRukMCIdOCPdDQ4h8d/zmnlKcQ4BTky6deyI6HRcGdEEhmsZMFpxFIDFp76I DVRKaoSDDkR9xsWhqXW156CrM9HLdCA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=vevH6DP6; dmarc=none; spf=pass (imf19.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664576865; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=85I3rGVXFgn/QGxZcCkkBe1bGhBtWpa+CEThV11T+ic=; b=xIs416nE2TVT9eAU+9wNHjDz9hFRxqCVJXNlRgOK6Dbo8a439YOlHqO0SD4fxeYctjjEYi dfkcJUkLlaQNJOTQJcBW99XQdWuI5dEP7JgqMdOEg2SyfT7N6/f+E+YMgMbTXYLCrom+Oc aGXlpR8XjNGIbklStqFzfkKvaDf4bMA= X-Rspamd-Queue-Id: 299851A0015 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=vevH6DP6; dmarc=none; spf=pass (imf19.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam03 X-Stat-Signature: yy4hehczb7ikxb71ju1as7ehc759joc7 X-HE-Tag: 1664576864-775602 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: On Fri, 30 Sep 2022 16:19:28 +0200 David Hildenbrand wrote: > Let's stop breaking COW via a fake write fault and let's use > FAULT_FLAG_UNSHARE instead. This avoids any wrong side effects of the fake > write fault, such as mapping the PTE writable and marking the pte > dirty/softdirty. > > Also, this fixes KSM interaction with userfaultfd-wp: when we have a KSM > page that's write-protected by userfaultfd, break_ksm()->handle_mm_fault() > will fail with VM_FAULT_SIGBUS and will simpy return in break_ksm() with 0. > The warning in dmesg indicates this wrong handling: We're at -rc7. I'd prefer to avoid merging larger patchsets at this time. Is there some minimal fix for 6.0 and -stable? Or is the problem non-serious enough to only fix it in 6.1 and later?