Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp35798rwb; Wed, 7 Dec 2022 14:05:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf71EU5Z/sqaTIT7/0XyzRHIYd9Spjk6VN2Y89GttWfBc5ZFmHLZqqSGP7BjVbd/zATs2iLZ X-Received: by 2002:a05:6402:240b:b0:469:9667:704c with SMTP id t11-20020a056402240b00b004699667704cmr7314858eda.318.1670450700698; Wed, 07 Dec 2022 14:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670450700; cv=none; d=google.com; s=arc-20160816; b=wOjJm3dYWO7zNz0wx9jqoWn6AgEdqJC8mwvaN1dU8deDjV5gHEQL8dOb4Aku6DrygW 2Rt0p0Vq9mekm/kJIRICKOW3dydBuiP1JtJ1He7Pd3EjkFkbyXwHsfn+yn30SiM2eCCQ ODH1MUMsGF7QI9bBCWY82WVQaSiQ5QIV88fCymSqXcDSrQJOX0Nwh/1DHpDJ8HvgDSfH 4ZROXYlaSr9UsvWGDea7czf9c7dKnx0nhP4wz8oh+zFPOwjtNQ7BTrTkIH/WQ1KZ/SDK J/1gpUV5rY/oY3+xonVBDG4go7YsOWHjfgDl1QYfFLPU8yb72OltkC6oNR/deDb0v3e4 u9vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NlgIItFvCF5msrDlp88m7tGNEV0TXA935fU3IghSF4Y=; b=UMlXgaksI4h9qNqgs1dZtrB5sFRuEDNgmjPEqxqE5ZjxQ+3gRxwZMXa3s7v1FDoTvC 3DA8akHOTON/0XoV6j4dhCog8eiZtfgZKXY5o7uRqDUUh5zG/xa8WmhniMIupm7APOE0 0AMUZYPw2KMcwBptzQu/0lhA8ZrNeu3DgHXHho9SZ94ZOzBwnLQH/ygeIj2CnBA3dwMO LuWL0JM6ZNZDDJYV2LagSKBmCOqB0X9z0sFMyJpcuDIY+eWzOILNhRnGzA8jwPGQ5fbc t1zXf8zoN+QECE3XhZFKoekDQ5bg4gNFyTZYORiUwVr3RWzrCasL/k/uivMm6t8/r/Ue weeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i6bpsbPm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a50d4d1000000b004623028c586si5005328edj.141.2022.12.07.14.04.34; Wed, 07 Dec 2022 14:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i6bpsbPm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbiLGWB2 (ORCPT + 74 others); Wed, 7 Dec 2022 17:01:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiLGWAf (ORCPT ); Wed, 7 Dec 2022 17:00:35 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D568566A for ; Wed, 7 Dec 2022 14:00:31 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id y25so8612945lfa.9 for ; Wed, 07 Dec 2022 14:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=NlgIItFvCF5msrDlp88m7tGNEV0TXA935fU3IghSF4Y=; b=i6bpsbPmq58+nflCdhR5+ZbY8ILawdzrcy00RQKwE8DryMhm9jpCuzGAZ68U8fT/Yt 2qWsZplx3WaI44mrdoZwsGCoOGEt3iIn3ZKE5H+EMB28ICbtR0g+eZyVDgYhdpoCIDUi tYUQcmlcXt3KbrZah4II3fdJv0pFCrAqhPGrWjn9SseqykqcmS13CuHmX6TeyvTjD6rO fUOBfanSZOTD72qKlsLWrJuw3stEYsbkd/3tksdijYH3uqImqRFfy5xmR12d/WB+y7pA a9hMG2Jul+fa/dblyA1kMTiM5y29X807iEoI/hcSQ8wMeJW6sj8uAmdHmMM2JCiuqhXp jlvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NlgIItFvCF5msrDlp88m7tGNEV0TXA935fU3IghSF4Y=; b=x4bInIdgrWdbEZCbAJ2zG1iDeKgVoRGi+XPGlkhGYNTAg10ozuVvZ3RacVX/x9Uceb ccWEEJ1OAovD17zOfQsVGxN4SG516US57UBsrNkUjr0K43rmilCf1EmNSgJD0Aidjz8r WkCM3zGKERQhld3Iwye7iIVc8C32UdzkNa/DHwEWDa5ph5imi+l3dVw2SUWzT2VmxOaC hGgz09g9yS/8RKQfFpKu6wJYMCw1vBh2J1zOVDQZTbyMfi8926sySowtgAdPk+/+HV4g JE3MKDax/EMtaNLf1txxGOCwkii8yJD26QIdWHEnDuwOr5Yu8GHAsNbOpZWFCLPzihJR /zNA== X-Gm-Message-State: ANoB5pkABFmUcAUDzu9Lm40/GLorVmbqcdcUDO86Od3mgxpAvMbxiv3e IGgRN3Acu+0X3i9X5mvJfCA= X-Received: by 2002:a19:5219:0:b0:4b5:9125:1432 with SMTP id m25-20020a195219000000b004b591251432mr1672355lfb.204.1670450429696; Wed, 07 Dec 2022 14:00:29 -0800 (PST) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id b25-20020ac25e99000000b004b4e6dab30esm3005093lfq.222.2022.12.07.14.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 14:00:27 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 1BDE85A0020; Thu, 8 Dec 2022 01:00:27 +0300 (MSK) Date: Thu, 8 Dec 2022 01:00:27 +0300 From: Cyrill Gorcunov To: Mel Gorman Cc: Pavel Emelyanov , Andrew Morton , gnome@rvzt.net, drawoc@darkrefraction.com, alan@lxorguk.ukuu.org.uk, linux-mm@kvack.org, linux-kernel@vger.kernel.org, bugzilla-daemon@bugzilla.kernel.org Subject: Re: [Bug 67651] Bisected: Lots of fragmented mmaps cause gimp to fail in 3.12 after exceeding vm_max_map_count Message-ID: References: <20140122190816.GB4963@suse.de> <20140122191928.GQ1574@moon> <20140122223325.GA30637@moon> <20140123103044.GE4963@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140123103044.GE4963@suse.de> User-Agent: Mutt/2.2.7 (2022-08-07) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Thu, Jan 23, 2014 at 10:30:44AM +0000, Mel Gorman wrote: > > The test case passes with this patch applied to 3.13 so that appears > to confirm that this is related to VM_SOFTDIRTY preventing merges. > Unfortunately I did not have slabinfo tracking enabled to double check > the number of vm_area_structs in teh system. Hi Mel! I'm really really sorry for replying that late, somehow missed the former bug report (note the bugzilla date message as Jan 23, 2014) so no wonder. Actually I don't understand yet how SOFTDIRTY can prevent merging. When VMAs are to merge we explicitly ignore softdirty flag /* * If the vma has a ->close operation then the driver probably needs to release * per-vma resources, so we don't attempt to merge those. */ static inline int is_mergeable_vma(struct vm_area_struct *vma, struct file *file, unsigned long vm_flags, struct vm_userfaultfd_ctx vm_userfaultfd_ctx, struct anon_vma_name *anon_name) { /* * VM_SOFTDIRTY should not prevent from VMA merging, if we * match the flags but dirty bit -- the caller should mark * merged VMA as dirty. If dirty bit won't be excluded from * comparison, we increase pressure on the memory system forcing * the kernel to generate new VMAs when old one could be * extended instead. */ if ((vma->vm_flags ^ vm_flags) & ~VM_SOFTDIRTY) return 0; ... } so the softdirty flag is not preventing VMAs from being merged. Cyrill