Message ID | 3aaf6c2338372866b85cea78140f5ea497ccc33d.1731566457.git.zhengqi.arch@bytedance.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 CE5EED65C4F for <linux-mm@archiver.kernel.org>; Thu, 14 Nov 2024 07:01:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65E656B009C; Thu, 14 Nov 2024 02:01:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E7A06B009E; Thu, 14 Nov 2024 02:01:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4445A6B009F; Thu, 14 Nov 2024 02:01:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1FCB46B009C for <linux-mm@kvack.org>; Thu, 14 Nov 2024 02:01:18 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D50F8A0F5C for <linux-mm@kvack.org>; Thu, 14 Nov 2024 07:01:17 +0000 (UTC) X-FDA: 82783803144.15.CE13B74 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf22.hostedemail.com (Postfix) with ESMTP id AB7A3C042B for <linux-mm@kvack.org>; Thu, 14 Nov 2024 07:00:20 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=O9aPFu9O; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731567497; a=rsa-sha256; cv=none; b=UgGUvt/pMChusw0N8v7wbLWUqODgBwu+TE2dx6yzdaljh9nj3R4T8C6LbL4Ko1zy4AKyRK TTBDrwL9dEZh4mIEIQpIVuCHHaUzj78oOqi5NgmCfEGThEgt6CaL1SKTA4wiTgkK8C1go8 bsV2xiD5prfEHqhKb6Lcb+v1kM5dg3g= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=O9aPFu9O; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf22.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.175 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731567497; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=U4ITvW0bkgyK2CcMa7XVY4WP6GOaHym7f9gBon+26RE=; b=ODlGzTtCLsboOjDqn0R43dCeitRHuoBvXJQrG6sNdSZquaK98n6sBYj/KFpkvU2ucW6G+l OrofGmLOotegNlsy4KzMh+pJ9Ye3jvobSILHOWV8xOEDzATVfGbuVFlJhGkVLxYNaJzDO7 IKAlEAbpNTHyGND+HoFkJ+5uEAm9qXY= Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-211c1bd70f6so3356955ad.0 for <linux-mm@kvack.org>; Wed, 13 Nov 2024 23:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1731567674; x=1732172474; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U4ITvW0bkgyK2CcMa7XVY4WP6GOaHym7f9gBon+26RE=; b=O9aPFu9OypWJTNYc0QroHhub5GovalnyN+XAvFj2WPr7xpaEtYJTZLQYxUg63ap82e /YrqRoNOPwYKnYhN6SFATng4qof4unchdY4Vm072VwfXGO5l7UCGJKsRHdr6VvzTad79 6sbSHSNwtWIdjwLB8qfK/49NJsw7Tjy7k/is8qBqkfFH/gzzYt1Hyg/j/xfQHvd/A78b 9JFMQ+C4yWZZA5YKIUy94N9LkOAUlzfklnJTlHHmlbrpfKXRprVhftKOY1PdI22XiZa/ 6bEJVv26buyz1fFZFRv5K6E8m+6tHdAvgKzIfmVr6jc1FYHHEN5VT6mzVl1mSFUdd0/U D3rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731567674; x=1732172474; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U4ITvW0bkgyK2CcMa7XVY4WP6GOaHym7f9gBon+26RE=; b=K/JPv8M4fj5ayxfVWRUb8IIWWqYLrMW37FDJnrnZFLjfupY7Olwd4SzGmH+gmHFb2G n9DirhQxyWuyPxNvUYo4nEXPDT2vg9r8ZZJhetxfmnCTklwnptTnTGUe6QfHQtE5l3wh F/k7fsJAMFvZtNA8Mym5H7UFZ3s1aKD1cZ3yH0Fo/txfMRY4cOWU7A0JTcBQWeDyRNr6 19XqMwZ56L3qojdfc1b/m0uIWUXht4acnTvgWyjQhOw61o8G6txjMUSCOPIn8EldNkLp K3/gvu78OubAJJfkTxWitK1lIbrS/B0WhQSXl9QLNbRkKERiwqz8zz0uY3bYew76XiTk HEVw== X-Forwarded-Encrypted: i=1; AJvYcCW9kKxdnzDf4xbZ/qI8u6YFQO1TkTOm5TqXEwB3W8GlYMtbxP6LFHeydrlnJaZtcwxq4EUajgr1Lw==@kvack.org X-Gm-Message-State: AOJu0Yxm0KHkvbveTw6mJOl+yiRpDbi2qr3REBaG0GI+G6LWiYgho1Av bRlcN88Isj/qFE53e+qGWJU3kozLs8L9sp6LT90Q3t6FodPQbA47+lR88XiuTI0= X-Google-Smtp-Source: AGHT+IHMIWeAj04FwYV71IQtIKJmFnsONOBKIQaZTsFXBlA5BRH3Z1Wl93O3jOYR0L0oLnRZ11BTuw== X-Received: by 2002:a17:903:11c3:b0:20c:5ffe:3ef1 with SMTP id d9443c01a7336-211c0f897b9mr36683095ad.17.1731567674099; Wed, 13 Nov 2024 23:01:14 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([63.216.146.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211c7d389c2sm4119065ad.268.2024.11.13.23.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 23:01:13 -0800 (PST) From: Qi Zheng <zhengqi.arch@bytedance.com> To: david@redhat.com, jannh@google.com, hughd@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, akpm@linux-foundation.org, peterx@redhat.com Cc: mgorman@suse.de, catalin.marinas@arm.com, will@kernel.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, x86@kernel.org, lorenzo.stoakes@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, zokeefe@google.com, rientjes@google.com, Qi Zheng <zhengqi.arch@bytedance.com> Subject: [PATCH v3 6/9] mm: make zap_pte_range() handle full within-PMD range Date: Thu, 14 Nov 2024 14:59:57 +0800 Message-Id: <3aaf6c2338372866b85cea78140f5ea497ccc33d.1731566457.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <cover.1731566457.git.zhengqi.arch@bytedance.com> References: <cover.1731566457.git.zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: p5uukmowkkx9cfqere6iitkpge1etmg9 X-Rspamd-Queue-Id: AB7A3C042B X-Rspamd-Server: rspam08 X-Rspam-User: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HVhWskUFbr2Q73I23qtnpWMTlV9tCX1vKamuCfLc07AjhTczrlX8JBOQ6g4NT3eVp4t7TFXBpv4d5FQPY+tDSaXspebIM6BtUktzwGQSCQdDNuVScwBL6S/5wCCBuJDRNJZpJINCy6rTihHEZSjnMP9SEcTmThIDpBni7XcL2Ky++4O80cTw0q+I4kpI99ayTR2NA8/InB6QzU0HhxPLr/qMejofSV4fGq9BYfVfgDDti/w7hihVUmJtrpnLI+1rMVOsRfhJds9crEMCX33x3zZDp2zlKmGDPJXL3lHrcCoOPxSOmun40tug6uSZ7u6NmdLjuDxXepq 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
synchronously scan and reclaim empty user PTE pages
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index bf5ac8e0b4656..8b3348ff374ff 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1711,6 +1711,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, pte_t *pte; int nr; +retry: tlb_change_page_size(tlb, PAGE_SIZE); init_rss_vec(rss); start_pte = pte = pte_offset_map_lock(mm, pmd, addr, &ptl); @@ -1758,6 +1759,13 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, if (force_flush) tlb_flush_mmu(tlb); + if (addr != end) { + cond_resched(); + force_flush = false; + force_break = false; + goto retry; + } + return addr; }