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 0E086C54E94 for ; Thu, 26 Jan 2023 15:10:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 850F56B0072; Thu, 26 Jan 2023 10:10:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 80CB88E0003; Thu, 26 Jan 2023 10:10:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A1ED8E0002; Thu, 26 Jan 2023 10:10:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5D0176B0072 for ; Thu, 26 Jan 2023 10:10:24 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 33A631C5B5E for ; Thu, 26 Jan 2023 15:10:24 +0000 (UTC) X-FDA: 80397286368.06.C8F1B0E Received: from outbound-smtp12.blacknight.com (outbound-smtp12.blacknight.com [46.22.139.17]) by imf13.hostedemail.com (Postfix) with ESMTP id 555C72001F for ; Thu, 26 Jan 2023 15:10:21 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674745821; 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: in-reply-to:in-reply-to:references:references; bh=jEcr6g0TFbk6JIq1trTlcJQ5QRqEGDH8X7Xlpu7OQWg=; b=YOOdBaJY5ZTXDpzSx5PjLSW3VNc5iXuCWpzRv3Z05CmxF/+cC+8McKgRvb8BzVVpyw/Ebr WQnPKHzImRKvdj6du5BkLff7S9jaOHfFjbGi7VuRV+7a3t9aFfuhIafkWdYL7cLb8EHMuf ZofW1TP/WqpZc0v/4p0wkJ+Qh+DD0SY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.17 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674745821; a=rsa-sha256; cv=none; b=qdt4E8LNcvzZyPq70a8RkXXG/eXNxDWvoJCnYCIwWCyNRHHOWcmYge+Wx36npjDaB7fVe0 YTGfYtsJePOiFHgiydEtxddEaE2QYBzDSBjo+iF3FgOAHxarTNeY+LYzPpsTi+guyYO0JD amFUJPhlz1/VObpK8tAhSKcHngqgIe0= Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp12.blacknight.com (Postfix) with ESMTPS id 94DCA1C3F9B for ; Thu, 26 Jan 2023 15:10:19 +0000 (GMT) Received: (qmail 15379 invoked from network); 26 Jan 2023 15:10:19 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 26 Jan 2023 15:10:18 -0000 Date: Thu, 26 Jan 2023 15:10:15 +0000 From: Mel Gorman To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, paulmck@kernel.org, mingo@redhat.com, will@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3 4/7] mm: replace vma->vm_flags direct modifications with modifier calls Message-ID: <20230126151015.ru2m26jkhwib6x6u@techsingularity.net> References: <20230125233554.153109-1-surenb@google.com> <20230125233554.153109-5-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230125233554.153109-5-surenb@google.com> X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: wsenbhnc7c3ekfu453qw8h6s9mtnpnre X-Rspamd-Queue-Id: 555C72001F X-HE-Tag: 1674745821-183110 X-HE-Meta: U2FsdGVkX1+qOlD929TspxXqfFPDVo5l7knFAPTSYe1acHlnlrvUNjegvQz5zhT0xKw2bzAbAk4ICT1QrCvkZBFucPcwerPxFbB18MrLyskG+2jEF67t0kdOWiJ/fdAz5EbQcBY7hrA3qniG4yL5y9qoND487XpoLPgI8sqJ4b6N1SyptY/GQesZW7LG3/ebDh0kfZn1mfDti0R1UZTKRjWpJtxdLhXqEID7rfa/sfmyEBgDzoDIT9GD8OEICmacyDapRW7HeJJhSph41ND+5qdyJuq5NyV4Uz0uCJnKPjNgz+kxv35+esAK7FUP0P3NiamSyyxcRo0xe7mNdGmGjWSwRKeJigzb8ruJPFkZUQR9T0pHg+hS1rNV6JhQuzIfwMqEG9zqrM3Gpf2Ic6Dy9AXcvYTE6W4WmQTyHwXj2EfaWc+YQzUIsDIg8VDhMS5yDzyFpBDLr5DbrCgZhbQTA9UR0KNptUwiTUow26JZSknLHOU1COxaKaUweQjDENx2vgnG9hHjNJsYCQCaFs7I789UdIeeXB6Aac8yRkQOe9o6CzV28Ian433yK52jlunDFLxcrx7C1jnYAsqKq0GoFtTsYJ8usTzA5XsROCnxJIAho7FT6Ppxuvt71o9b3TJvqrvbCR3rLVqh/OTbn0QncVIbxa0H3+CM+Xa2Nljxx7VqrTUhP7t8k3nKf6JpyvRSsZ0Tuthhl1BxErNOmR61dWs2AIdUftCBppW18/heMeCDH3gyZjsFnpWCGl0GJJx8PUBmDB2ft31si121mU2LsH2eoVSgo5obPbkGtlQLoSPB6z2Uy/T7JUlwpRhbv5OdLCsOL+XQ+hj7jsQErkXcgmh9VgGxvl5VqU2Xz9Pcvdh6UwBtJ9heWZAAOawlYUgRfK2LLmKqop1T+Gxk3mgzE8dqUHoLKB90mY4dg1+kdFMgXf2bzIPfYjATtZByZqBodOHWg8Pp3EUq8CkfIRI qOmcME/D owA88k4OQxPbt7w3QOvvr16RZ86QIdI/yX+rgmtHToTt9Rbaa7TT0X/DL69bxG2CBEl+BmQQEMZQRRpUCpvj6RLS53JphyGC3E+i883PH0CGive/4uW9kCjoF9CWdFylS8sIre3DkZA/tRyTuF21MBIcJhs8hbjB90c83tMJviUaVjiPu56iMZ+4urFPLPoUrAKTxBBhn9xl6FPNlhYREzypd2xBzmrqc9e9PQoq6GmLumT2bgp+wTv65tW1bHnWCwCsB+zkrjmVkVIrYw9rE7vLQwy7KCw8oRK8IymU0DEnNp1IY4TgvWMDuzujpfc9i0bfq16bhaM2gN19dwCoOcJBQCUYAyvUFNOK6K/u86IH8STGt1aJi4EsZig== 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 Wed, Jan 25, 2023 at 03:35:51PM -0800, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan > Acked-by: Michal Hocko Acked-by: Mel Gorman Minor comments that are safe to ignore. I think a better name for mod_vm_flags is set_clear_vm_flags to hint that the first flags are to be set and the second flags are to be cleared. For this patch, it doesn't matter, but it might avoid accidental swapping in the future. reset_vm_flags might also be better named as reinit_vma_flags (or vma_flags_reinit). Maybe also encourage the use of [set|clear_mod]_vm_flags where possible in the comment to track exactly what is changing and why. Some cases like userfaultfd just want to clear __VM_UFFD_FLAGS but altering the flow in this patch is inappropriate and error prone. Others such as the infiniband changes and madvise are a lot more complex. -- Mel Gorman SUSE Labs