Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp113753iob; Tue, 17 May 2022 20:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgIuAn1I3Hd9Xr/vKfV2rIqyki/kdh94Y8ZHZHyKF78h5hLEtAU5X7RkQeu9zh5IpY+ZY5 X-Received: by 2002:a63:202:0:b0:3f2:75a7:cd28 with SMTP id 2-20020a630202000000b003f275a7cd28mr9993618pgc.537.1652845238981; Tue, 17 May 2022 20:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652845238; cv=none; d=google.com; s=arc-20160816; b=eVcmDgKQRQcy0pE5P2vNsO7E1tuHZmc57oWjxlNGxt84CgVUXZErHwZEWfioXG3zkS GnylbX33tcDmRyesegdodsIR87KfAVFBmZe7QhOw1HiTnbaBQ93pzSdfgta+9hlyKYHg ROHY7InyMk/oWC8fqNuWXUvDI9km5cDyco2TEPKWDbPpOKmsgMXPZsZa5m/+K9b5uoMB mxgetmud3hiVmrnQK4SazSKP8a1iJqlcLeHIGvTe9beomNiBNkRWjHd542G8QAmTprS9 x78qSGn6mO1aWq0SHdNdUb1J57V4O63ump6nJeE6O0uy8EhqtrGN1dR7mAc0CGu7qlSc eMdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=X+ZIsvVjUuwlh/wMsd673AwYnSIKugcP1RnbxXgeB7M=; b=kYMEJsPiKEOdclxrsLMFZtx6YmN+HzKP6jH29wsEJevaU47knCiQWd/xh8yyA1LHD9 j8tENdRQDh7iTLWT4Qp4LJPPwmRrsbd5Rc5/l4377GK+4a99eVVsX/2Gp3s1TQGxC89u N+1ZRC6uLBLzTruBvjtw7NOQ7T0nD3B5WFUWPb+V3Ft3p/Z2RqkOAcwWKGo6Y+i56evX mwdPRBNDvNF2Kov2NL7/7DFIORx+xC5s3VwtjOqFPD6fqLugzRYT+ITgb8xR/i5qVw9A hvRFNL8I8HrygmZl/SCFqNpvYYuB/F3d9Rb/wG1jfTzejd5hX53rDtQRkY8D/7fEeNcE P5GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=V8osDecp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b6-20020a170902d50600b00153b2d1645bsi1549577plg.99.2022.05.17.20.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=V8osDecp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3888C6C57A; Tue, 17 May 2022 20:29:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351097AbiEQQmU (ORCPT + 99 others); Tue, 17 May 2022 12:42:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351081AbiEQQmP (ORCPT ); Tue, 17 May 2022 12:42:15 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35136403C3 for ; Tue, 17 May 2022 09:42:14 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id d15so32312753lfk.5 for ; Tue, 17 May 2022 09:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=X+ZIsvVjUuwlh/wMsd673AwYnSIKugcP1RnbxXgeB7M=; b=V8osDecpKG1CjUJgHbXhszmxjy2U6L5nGE72cpZ9wzdBseZt01yt+Z4mmHiEAt594M BNqhFNGWjAm8E9llNlZJhF++9DHOQfxrAZVLSUa3Axy8oqQ+ReQqs74mJBVZgyQZa4lT qOpPZirzW3loPIh1wPdjoJshtTrfYXMGx/KgiEQMCw5CVv0fVVqc0R5kTe6xea1aoeRo UCxDV8YnZi0hgkTAF5f38w3ARVMhSRvJbZt0TIhplhn9V70cOcfuemjsVkA+vfLl5GYQ fnELcWbYh9v4jj6y6/n6LCNH9i8RWUqtgra/HnsQkQlsOI8pNTwR4uTbKE3aFuawAaZl 6jVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=X+ZIsvVjUuwlh/wMsd673AwYnSIKugcP1RnbxXgeB7M=; b=6i6kPYZ9xaNRX6NNTBzl2SJO+6CJzpvBRjDAH6wQogAVG7Zbg1+0DIGtVNz8SX/BVM J7HhexbuiRvFsRjjQLWIl0+5ZDFkhvKFZvzOKwfeLYdzL6XzeF9iRPgWBJ45MGodtmIY aHzjDKGxNQ2I6iBzdHdgY2TDth7VH8/KhZnauqZwPG5/ccvFTwfSHpod0MQchUFg/qy5 a2Wd2G/S2tTiFqvojl4++o9qVYgLYdpTHaz06dfAX+vMXWluv6hYl3EZGBUz5VnAfNrQ eBkNRrh/R8unHHLyQ1Qy5c66dY1+20VmUL+2idrEb6g1KeBkx61yuAOXI2jFRqIVBpGB WNAg== X-Gm-Message-State: AOAM53118vfqW0BLOrzhImYSi7jfx4cYMKnEBFRHD0gjh64UnQVPHkFH zfDkv67Vh2jhsTdYIamYeaX/aA== X-Received: by 2002:a05:6512:4008:b0:450:bd56:50b3 with SMTP id br8-20020a056512400800b00450bd5650b3mr17936796lfb.552.1652805732538; Tue, 17 May 2022 09:42:12 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id a2-20020a056512390200b00477b38eabd1sm6624lfu.94.2022.05.17.09.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 09:42:11 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 74B9F10453E; Tue, 17 May 2022 19:44:03 +0300 (+03) Date: Tue, 17 May 2022 19:44:03 +0300 From: "Kirill A. Shutemov" To: Jakub =?utf-8?Q?Mat=C4=9Bna?= Cc: linux-mm@kvack.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, vbabka@suse.cz, mhocko@kernel.org, mgorman@techsingularity.net, willy@infradead.org, liam.howlett@oracle.com, hughd@google.com, riel@surriel.com, rostedt@goodmis.org, peterz@infradead.org, david@redhat.com Subject: Re: [RFC PATCH v3 0/6] Removing limitations of merging anonymous VMAs Message-ID: <20220517164403.nabrtbkezex7uof4@box.shutemov.name> References: <20220516125405.1675-1-matenajakub@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220516125405.1675-1-matenajakub@gmail.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Mon, May 16, 2022 at 02:53:59PM +0200, Jakub Matěna wrote: > This is a series of patches that try to improve merge success rate when > VMAs are being moved, resized or otherwise modified. > > Motivation > In the current kernel it is impossible to merge two anonymous VMAs > if one of them was moved. That is because VMA's page offset is > set according to the virtual address where it was created and in > order to merge two VMAs page offsets need to follow up. > Another problem when merging two faulted VMA's is their anon_vma. In > current kernel these anon_vmas have to be the one and the same. > Otherwise merge is again not allowed. > There are several places from which vma_merge() is called and therefore > several use cases that might profit from this upgrade. These include > mmap (that fills a hole between two VMAs), mremap (that moves VMA next > to another one or again perfectly fills a hole), mprotect (that modifies > protection and allows merging with a neighbor) and brk (that expands VMA > so that it is adjacent to a neighbor). > Missed merge opportunities increase the number of VMAs of a process > and in some cases can cause problems when a max count is reached. Hm. You are talking about missed opportunities, but do you know any workload that would measurably benefit from the change? The changes are not trivial. And rmap code is complex enough as it is. I expect common cases to get slower due to additional checks that do not result in more merges. I donno, the effort looks dubious to me as of now. -- Kirill A. Shutemov