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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8260DC4321E for ; Fri, 18 Nov 2022 16:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242306AbiKRQp7 (ORCPT ); Fri, 18 Nov 2022 11:45:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242234AbiKRQpk (ORCPT ); Fri, 18 Nov 2022 11:45:40 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C7FD13EAF; Fri, 18 Nov 2022 08:45:34 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B457722809; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=oTTvOF9em1RBHrcDz3sPtZD55HB28JQKz0rq8O6fqbEdz69a/AXJF4jT92zC2TnMfoTP5o N+/92zbPBa11XH4uj3j1PVuX4IFT5iMf+cuDaOPUiGYk17AhOFewCKsW2Vloee6rUH2cev ywRRIq+dF6sPyizq6eVC4qLT8N+v1Fc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=w1a8SK5GtUV98VIRjCKPQTv/uTPpGl8AZCdCXalMKOScuLDWEelI6GTSk7XWYEsOviak8d 9ZPPVSaQ1GZLctAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CE531345B; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /+1SCqy2d2MoEAAAMHmgww (envelope-from ); Fri, 18 Nov 2022 16:45:32 +0000 Message-ID: Date: Fri, 18 Nov 2022 17:45:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Content-Language: en-US To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, Linus Torvalds , Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Matthew Wilcox , Mike Kravetz , Muchun Song , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> From: Vlastimil Babka In-Reply-To: <20221116102659.70287-5-david@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93F4EC4332F for ; Fri, 18 Nov 2022 16:46:30 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NDN386Dt0z3f2x for ; Sat, 19 Nov 2022 03:46:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=oTTvOF9e; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=w1a8SK5G; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.cz (client-ip=195.135.220.28; helo=smtp-out1.suse.de; envelope-from=vbabka@suse.cz; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=oTTvOF9e; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=w1a8SK5G; dkim-atps=neutral Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4NDN274vrxz3cKn for ; Sat, 19 Nov 2022 03:45:35 +1100 (AEDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B457722809; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=oTTvOF9em1RBHrcDz3sPtZD55HB28JQKz0rq8O6fqbEdz69a/AXJF4jT92zC2TnMfoTP5o N+/92zbPBa11XH4uj3j1PVuX4IFT5iMf+cuDaOPUiGYk17AhOFewCKsW2Vloee6rUH2cev ywRRIq+dF6sPyizq6eVC4qLT8N+v1Fc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=w1a8SK5GtUV98VIRjCKPQTv/uTPpGl8AZCdCXalMKOScuLDWEelI6GTSk7XWYEsOviak8d 9ZPPVSaQ1GZLctAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CE531345B; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /+1SCqy2d2MoEAAAMHmgww (envelope-from ); Fri, 18 Nov 2022 16:45:32 +0000 Message-ID: Date: Fri, 18 Nov 2022 17:45:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Content-Language: en-US To: David Hildenbrand , linux-kernel@vger.kernel.org References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> From: Vlastimil Babka In-Reply-To: <20221116102659.70287-5-david@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Nadav Amit , linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, Shuah Khan , Andrea Arcangeli , linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, David Airlie , x86@kernel.org, Hugh Dickins , Matthew Wilcox , Christoph Hellwig , Jason Gunthorpe , linux-media@vger.kernel.org, Arnd Bergmann , John Hubbard , linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, Alex Williamson , Peter Xu , Muchun Song , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Oded Gabbay , linux-mips@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-se curity-module@vger.kernel.org, linux-alpha@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Lucas Stach , Linus Torvalds , Mike Kravetz Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3F16C4332F for ; Fri, 18 Nov 2022 16:45:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FA6210E771; Fri, 18 Nov 2022 16:45:39 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B14410E0A3; Fri, 18 Nov 2022 16:45:35 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B457722809; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=oTTvOF9em1RBHrcDz3sPtZD55HB28JQKz0rq8O6fqbEdz69a/AXJF4jT92zC2TnMfoTP5o N+/92zbPBa11XH4uj3j1PVuX4IFT5iMf+cuDaOPUiGYk17AhOFewCKsW2Vloee6rUH2cev ywRRIq+dF6sPyizq6eVC4qLT8N+v1Fc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=w1a8SK5GtUV98VIRjCKPQTv/uTPpGl8AZCdCXalMKOScuLDWEelI6GTSk7XWYEsOviak8d 9ZPPVSaQ1GZLctAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CE531345B; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /+1SCqy2d2MoEAAAMHmgww (envelope-from ); Fri, 18 Nov 2022 16:45:32 +0000 Message-ID: Date: Fri, 18 Nov 2022 17:45:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Content-Language: en-US To: David Hildenbrand , linux-kernel@vger.kernel.org References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> From: Vlastimil Babka In-Reply-To: <20221116102659.70287-5-david@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Nadav Amit , linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, Shuah Khan , Andrea Arcangeli , linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, x86@kernel.org, Hugh Dickins , Matthew Wilcox , Christoph Hellwig , Jason Gunthorpe , linux-media@vger.kernel.org, Arnd Bergmann , John Hubbard , linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, Alex Williamson , Peter Xu , Muchun Song , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Oded Gabbay , linux-mips@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-alpha@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Linus Torvalds , Mike Kravetz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E45F1C433FE for ; Fri, 18 Nov 2022 16:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s2XecPHjWGH8EVUdRKcKtstAL1f8VYgsH9qNx6klBOE=; b=3Sn669XooHtVe9 9aD9ztb1CqYv+BDw6un2BR01cAD2YMMJg2OWI6xZNMOitrJyPMWe2hub6lTAumG65I956Q8P3JLEn TYmwdwVI4C7k+3PtpLHGwAfU9AwKCIjSueeBXL2B7sIbtm0h6mX70R1dBwgSTz+0/nKdolX4OA8h2 10ZGnjkB1oHlUwkNgDhtYfgt0m/Q15TBKDqGGthn5ZiuBlt7sZ8Reg0zoqPS4kRKiM1cKvqzKqXq8 5zmyfN/C4arwkF3cdciVhqDWhKJSexQv8ACoj7i0vYikrXhyvEmTagN+eSjfr9INuEX3fDXALmRNC TleqLGLcD+Mz5dkLYncg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow4X8-005UAx-JQ; Fri, 18 Nov 2022 16:48:07 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow4Uh-005SUv-DI; Fri, 18 Nov 2022 16:45:36 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B457722809; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=oTTvOF9em1RBHrcDz3sPtZD55HB28JQKz0rq8O6fqbEdz69a/AXJF4jT92zC2TnMfoTP5o N+/92zbPBa11XH4uj3j1PVuX4IFT5iMf+cuDaOPUiGYk17AhOFewCKsW2Vloee6rUH2cev ywRRIq+dF6sPyizq6eVC4qLT8N+v1Fc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=w1a8SK5GtUV98VIRjCKPQTv/uTPpGl8AZCdCXalMKOScuLDWEelI6GTSk7XWYEsOviak8d 9ZPPVSaQ1GZLctAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CE531345B; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /+1SCqy2d2MoEAAAMHmgww (envelope-from ); Fri, 18 Nov 2022 16:45:32 +0000 Message-ID: Date: Fri, 18 Nov 2022 17:45:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Content-Language: en-US To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, Linus Torvalds , Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Matthew Wilcox , Mike Kravetz , Muchun Song , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> From: Vlastimil Babka In-Reply-To: <20221116102659.70287-5-david@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_084535_632392_BF60956D X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 640A2C4332F for ; Fri, 18 Nov 2022 16:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZdvIr3bBLNxYrErD6Hwiy30XxK6C3XPDPb5Gm3Hscxk=; b=Uu/YrlC4Q7UEqN pvlLQbQpFRduffcFpoCXfOVWlCf1fKoA3yH1DtlchxaO/kCKuTic8m/ZP+LtJaaC+oBceORnwrfWc hBg/85LDTAMjhSkqxun8ry5zUBgtsrlZkZzMTh+owF/KPVX8/3D4ju7ZeujsxPNqFByDHn9y/IWP4 6O0Um72s2LMtmsy6xC9GbdK5gzWUTWGhwSSI4dIkLE1ynvkIpPNs1M3BoJdeN2u6xkeXRntw/gvWE UzUXZDfXegCKqx6baf+JyaXIQtmJv980+gw2V2xxqrQF8ialc0T/17j5CJRNdoYauEwlgYyCh1U+n wYu3koxT1qyrKfFybkjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow4Xc-005UW1-Vm; Fri, 18 Nov 2022 16:48:37 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow4Uh-005SUv-DI; Fri, 18 Nov 2022 16:45:36 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B457722809; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=oTTvOF9em1RBHrcDz3sPtZD55HB28JQKz0rq8O6fqbEdz69a/AXJF4jT92zC2TnMfoTP5o N+/92zbPBa11XH4uj3j1PVuX4IFT5iMf+cuDaOPUiGYk17AhOFewCKsW2Vloee6rUH2cev ywRRIq+dF6sPyizq6eVC4qLT8N+v1Fc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=w1a8SK5GtUV98VIRjCKPQTv/uTPpGl8AZCdCXalMKOScuLDWEelI6GTSk7XWYEsOviak8d 9ZPPVSaQ1GZLctAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2CE531345B; Fri, 18 Nov 2022 16:45:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /+1SCqy2d2MoEAAAMHmgww (envelope-from ); Fri, 18 Nov 2022 16:45:32 +0000 Message-ID: Date: Fri, 18 Nov 2022 17:45:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Content-Language: en-US To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, Linus Torvalds , Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Matthew Wilcox , Mike Kravetz , Muchun Song , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> From: Vlastimil Babka In-Reply-To: <20221116102659.70287-5-david@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_084535_632392_BF60956D X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlastimil Babka Date: Fri, 18 Nov 2022 16:45:31 +0000 Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Message-Id: List-Id: References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> In-Reply-To: <20221116102659.70287-5-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, Linus Torvalds , Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Matthew Wilcox , Mike Kravetz , Muchun Song , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlastimil Babka Subject: Re: [PATCH mm-unstable v1 04/20] mm: add early FAULT_FLAG_UNSHARE consistency checks Date: Fri, 18 Nov 2022 17:45:31 +0100 Message-ID: References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-5-david@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=oTTvOF9em1RBHrcDz3sPtZD55HB28JQKz0rq8O6fqbEdz69a/AXJF4jT92zC2TnMfoTP5o N+/92zbPBa11XH4uj3j1PVuX4IFT5iMf+cuDaOPUiGYk17AhOFewCKsW2Vloee6rUH2cev ywRRIq+dF6sPyizq6eVC4qLT8N+v1Fc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668789932; h=from:from:reply-to: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; bh=gGWCBwR6W7N/T/oKVxq15JaXduGL74ybELQMLEOROjQ=; b=w1a8SK5GtUV98VIRjCKPQTv/uTPpGl8AZCdCXalMKOScuLDWEelI6GTSk7XWYEsOviak8d 9ZPPVSaQ1GZLctAg== Content-Language: en-US In-Reply-To: <20221116102659.70287-5-david@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane-mx.org@lists.ozlabs.org Sender: "Linuxppc-dev" Content-Type: text/plain; charset="us-ascii" To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-ia64@vger.kernel.org, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Nadav Amit , linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, Shuah Khan , Andrea Arcangeli , linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, David Airlie , x86@kernel.org, Hugh Dickins , Matthew Wilcox , Christoph Hellwig , Jason Gunthorpe , linux-media@vger.kernel.org, Arnd Bergmann , John Hubbard , linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, Alex Williamson , Peter Xu , Muchun Song , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Oded On 11/16/22 11:26, David Hildenbrand wrote: > For now, FAULT_FLAG_UNSHARE only applies to anonymous pages, which > implies a COW mapping. Let's hide FAULT_FLAG_UNSHARE early if we're not > dealing with a COW mapping, such that we treat it like a read fault as > documented and don't have to worry about the flag throughout all fault > handlers. > > While at it, centralize the check for mutual exclusion of > FAULT_FLAG_UNSHARE and FAULT_FLAG_WRITE and just drop the check that > either flag is set in the WP handler. > > Signed-off-by: David Hildenbrand > --- > mm/huge_memory.c | 3 --- > mm/hugetlb.c | 5 ----- > mm/memory.c | 23 ++++++++++++++++++++--- > 3 files changed, 20 insertions(+), 11 deletions(-) Reviewed-by: Vlastimil Babka