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 A82EEC433FE for ; Thu, 13 Jan 2022 15:28:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3847A6B0072; Thu, 13 Jan 2022 10:28:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30D096B0073; Thu, 13 Jan 2022 10:28:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15FD96B0074; Thu, 13 Jan 2022 10:28:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 0482C6B0072 for ; Thu, 13 Jan 2022 10:28:25 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C28AE944FA for ; Thu, 13 Jan 2022 15:28:24 +0000 (UTC) X-FDA: 79025645328.10.6BB8A92 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf15.hostedemail.com (Postfix) with ESMTP id 399BFA0007 for ; Thu, 13 Jan 2022 15:28:24 +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 DED76210EC; Thu, 13 Jan 2022 15:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642087702; 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=7cqrnRdh2pgxD32R7R/h/b7vRu6FcKgviKLP+6X2OXI=; b=sJ0Ijb4QKHeneUym0npkgsYuC6txsT4uz3G41uUp7KRSvjiCcOzTi8Iu8FY7knE+NUSvoE 7dmfVva7qUfhdPWvYIh42oR1WpP1/flORLUsR0vNueBMhcU7dhJWgllUqoruQToyLUsGQE DFmoJmIUzLk+zoMf5de/GejzslNt1Sg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642087702; 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=7cqrnRdh2pgxD32R7R/h/b7vRu6FcKgviKLP+6X2OXI=; b=8IRnTqIrOSlnvbWHgFXQfiwdJtMWSSOxvqd3/xVIOst406XIi1iV37xx0KwUEjDsK00wsW eALC398I+NF3d3Ag== 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 91F4C13B55; Thu, 13 Jan 2022 15:28:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SAKlIhZF4GFbGAAAMHmgww (envelope-from ); Thu, 13 Jan 2022 15:28:22 +0000 Message-ID: Date: Thu, 13 Jan 2022 16:28:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH v4 21/66] mm/mmap: Change do_brk_flags() to expand existing VMA and add do_brk_munmap() Content-Language: en-US To: Liam Howlett , "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton Cc: Song Liu , Davidlohr Bueso , "Paul E . McKenney" , Matthew Wilcox , Laurent Dufour , David Rientjes , Axel Rasmussen , Suren Baghdasaryan , Rik van Riel , Peter Zijlstra , Michel Lespinasse , Jerome Glisse , Minchan Kim , Joel Fernandes , Rom Lemarchand References: <20211201142918.921493-1-Liam.Howlett@oracle.com> <20211201142918.921493-22-Liam.Howlett@oracle.com> From: Vlastimil Babka In-Reply-To: <20211201142918.921493-22-Liam.Howlett@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 399BFA0007 X-Stat-Signature: t9afb4qz7sk66tt5eepnwd83xsfzrqn5 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=sJ0Ijb4Q; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=8IRnTqIr; dmarc=none; spf=pass (imf15.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam06 X-HE-Tag: 1642087704-515461 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 12/1/21 15:29, Liam Howlett wrote: > @@ -1989,6 +2013,7 @@ EXPORT_SYMBOL(get_unmapped_area); > struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) > { > struct vm_area_struct *vma; > + MA_STATE(mas, &mm->mm_mt, addr, addr); > > mmap_assert_locked(mm); > /* Check the cache first. */ > @@ -1996,7 +2021,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) > if (likely(vma)) > return vma; > > - vma = mt_find(&mm->mm_mt, &addr, ULONG_MAX); > + vma = mas_find(&mas, -1); > if (vma) > vmacache_update(addr, vma); > return vma; Oh and this change to find_vma() was supposed to go to the next patch, no?