Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1682230rdb; Wed, 31 Jan 2024 06:12:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFq5UR2CAstmbyWwlZcxPNCaBel5h23y8p3ufCCDyyKRAABq8fZNMHCfPqLKsIVXspbqRuk X-Received: by 2002:a17:906:bfe6:b0:a35:51b1:c757 with SMTP id vr6-20020a170906bfe600b00a3551b1c757mr1233537ejb.38.1706710366483; Wed, 31 Jan 2024 06:12:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706710366; cv=pass; d=google.com; s=arc-20160816; b=v53z38PZPa8xwkhRTbT4NA7G76HP/D6dSi/lC6SCLgOpwmpxwaTr5db1ff1mlTk9ta k6ZEHRz7oCkSB4gJElCLP00zRZyULMLPnSrJ92yq1byyPhqoHwvrPD0EX4n23CxJl+kk qaQS2cT7ym1J2lgwyhVsfjYywEEpNi7pFr78CDH+Tnc3GyUTW2eCuSmCZdQpfBrFTqzY KVspjwGwjj/iJWBYcZOC5GIgdr52wOWNOyWJk9R3Y5rmjVJuXEvGNKbf8XWFm/jj6JhQ ukKXcuDPnHlwQBBeBFHB6lbGy7o/pWO67qZMlys3XRza86fn5b3PpmRO6fYHmn3yjeZI Zprw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=m2cxDnakp497+YroEa+q5vx8Sh99BmyBojVBJFGfpzs=; fh=CmnCBrkUUqwFPFrZL8cxY5VT9qOBVxrikc+RXJsLR5c=; b=fNYwwIDvtNLWaha3QTz6VA4Y0EgTvKJxPNOKiO5LPs/x9vnz0YVqUgyMqY6Hn4rLxp mEwBQ2GwQMUq+Gj1tumj/rTtobDBst2PDzzK7rWuKtJVMkzNCRoNETjsEVWsC/FG7TAh zsi6GIFuy6DwSo+R2kZTIBszqhcBoI0CZltl70NLjIp0Cjo1vAUcnpDHaz505pD0BXJm IFPWHlnyyq8ThSUfhn5piokx6DP2mRNt3p6iyBQ5NnI5xLDAEKtHbhvKQPwY+vWXRqbh ddccVZx8EUB/tD6ePrnps7tRyvlZP4HmuGjfl7h1NjmNsPocFE/epeUYhMVs77bCqRdJ 7jlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="WLhYD4V/"; dkim=pass header.i=@suse.com header.s=susede1 header.b="WLhYD4V/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-46551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCWw9x3wSpVVbRd2anEm/igzFvRPAQuJ1yc4LVFVh2Qs1tPmnb712shhmxlSh9KK34LPN+8ygrUIlreKLm+rikBKThY2rqLopBrx368GBw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ay10-20020a170906d28a00b00a36862f7654si421535ejb.25.2024.01.31.06.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 06:12:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="WLhYD4V/"; dkim=pass header.i=@suse.com header.s=susede1 header.b="WLhYD4V/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-46551-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5A9501F2D85F for ; Wed, 31 Jan 2024 14:04:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43BC880C17; Wed, 31 Jan 2024 14:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="WLhYD4V/"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="WLhYD4V/" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70D7956B9D; Wed, 31 Jan 2024 14:03:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706709835; cv=none; b=KqnzXkBtc3Q43GTitseB39PWa172hE4w13j6sikBANWgrCUeAXjNSoZH9Q3RtKX+hImiXPisqnPeVSgGqnKfKDNOKLB0ik5nMcIbb21Dx7Tne0uWZwklqMsru/jX5UA29qk4Y1GrDnBY3D9IDtWxG0uo0bZC8g0USShOGJZZzZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706709835; c=relaxed/simple; bh=yK5tDuzjN62NKpY1IUEhVf1AyPpCBKY++LbxRsHYWaQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rJmhGH16zyr2Pzj47wm/QsITtiIBca4LC2cejiipW1OLciE7ZbBu4wV1rPTjSEAJnuUetoPdFtB2YL8j0X7FeTc4BeiZVIlJBgCmvohhnac7z6Dj4X2N7NAHyiZdANr7ThviBhrDpibv2W07p0+bsxy/98JO/QUbqJ5v3uzDgyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=WLhYD4V/; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=WLhYD4V/; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E1AE41FB8A; Wed, 31 Jan 2024 14:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706709827; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m2cxDnakp497+YroEa+q5vx8Sh99BmyBojVBJFGfpzs=; b=WLhYD4V/x/UZrHhY+6rCUJyqgymCrrsKeuLtGDQJmSHaoC3k23j7X0NG3vOMfDtXnIsMtY jZ5h10f3ZWcsECbVFDV7u/QcfFFmgBDZc+aS1k+0Rtk506F6YwOW9pHPE/hJ/vKoBvOmPc ryDw7jWI4W009OBH2S6hA4+jm0itigA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706709827; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m2cxDnakp497+YroEa+q5vx8Sh99BmyBojVBJFGfpzs=; b=WLhYD4V/x/UZrHhY+6rCUJyqgymCrrsKeuLtGDQJmSHaoC3k23j7X0NG3vOMfDtXnIsMtY jZ5h10f3ZWcsECbVFDV7u/QcfFFmgBDZc+aS1k+0Rtk506F6YwOW9pHPE/hJ/vKoBvOmPc ryDw7jWI4W009OBH2S6hA4+jm0itigA= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BDC6F1347F; Wed, 31 Jan 2024 14:03:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mJp5LENTumVaDwAAD6G6ig (envelope-from ); Wed, 31 Jan 2024 14:03:47 +0000 Date: Wed, 31 Jan 2024 15:03:47 +0100 From: Michal Hocko To: David Hildenbrand Cc: Yin Fengwei , linux-kernel@vger.kernel.org, Linus Torvalds , linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , Ryan Roberts , Catalin Marinas , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Peter Zijlstra , Michael Ellerman , Christophe Leroy , "Naveen N. Rao" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, "Huang, Ying" Subject: Re: [PATCH v1 0/9] mm/memory: optimize unmap/zap with PTE-mapped THP Message-ID: References: <20240129143221.263763-1-david@redhat.com> <4ef64fd1-f605-4ddf-82e6-74b5e2c43892@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [0.40 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_RATELIMIT(0.00)[to_ip_from(RLmz57jmx331iqhbrcj9q94ym8)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_TWELVE(0.00)[26]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[intel.com,vger.kernel.org,linux-foundation.org,kvack.org,infradead.org,arm.com,kernel.org,linux.ibm.com,gmail.com,ellerman.id.au,csgroup.eu,arndb.de,lists.ozlabs.org]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[28.90%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.40 On Wed 31-01-24 11:16:01, David Hildenbrand wrote: [...] > This 10000 pages limit was introduced in 53a59fc67f97 ("mm: limit mmu_gather > batching to fix soft lockups on !CONFIG_PREEMPT") where we wanted to handle > soft-lockups. AFAIR at the time of this patch this was mostly just to put some cap on the number of batches to collect and free at once. If there is a lot of free memory and a large process exiting this could grow really high. Now that those pages^Wfolios can represent larger memory chunks it could mean more physical memory being freed but from which might make the operation take longer but still far from soft lockup triggering. Now latency might suck on !PREEMPT kernels with too many pages to free in a single batch but I guess this is somehow expected for this preemption model. The soft lockup has to be avoided because this can panic the machine in some configurations. -- Michal Hocko SUSE Labs