Message ID | 76c95ee641da7808cd66d642ab95841df4048295.1733305182.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 721DFE7716D for <linux-mm@archiver.kernel.org>; Wed, 4 Dec 2024 11:11:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08B806B009F; Wed, 4 Dec 2024 06:11:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 03BC56B00A0; Wed, 4 Dec 2024 06:11:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E21296B00A1; Wed, 4 Dec 2024 06:11:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C3C066B009F for <linux-mm@kvack.org>; Wed, 4 Dec 2024 06:11:23 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7991F160F5C for <linux-mm@kvack.org>; Wed, 4 Dec 2024 11:11:23 +0000 (UTC) X-FDA: 82857009774.08.9D9A66A Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf05.hostedemail.com (Postfix) with ESMTP id 18417100015 for <linux-mm@kvack.org>; Wed, 4 Dec 2024 11:10:53 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=K6PX0vHf; spf=pass (imf05.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733310671; 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=7pv7uitRReKN+1XEtzxbevTSt67jmAqoi+0p+H++uGg=; b=ieCDyBkEpsCr4rOWLoIwTP5VRMDN9JilzNdSzLuTO7rk0yPdEgY/1l819bxzc8UPiuE3B6 KsajywLn39K+8HkaKcpRPvJD8jad65zTLizCMNMDgOJr5qyroQ4sBuBJFY7zVhZY4iS0BP 8q3zExXKgWukGnG9TgJLyJXXF3AxXwQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733310671; a=rsa-sha256; cv=none; b=ApI9XDx3VTH3M/Z2syTWNe2lP/8ulB8ITZjnTMiLox1Ws/MsQlCGLAFb+HqaDZzuzH8Wb0 TDz8ZG0RdYQZ3kMCTuzXLsNqVAk03lNV/PPPLU+9exOzdoOuQOjvCsfAQbv7u+t1XcyxK9 KIBblXO/rr73dHYTDyCcqY9BYPZpP4U= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=K6PX0vHf; spf=pass (imf05.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.176 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-215da73e256so3576825ad.0 for <linux-mm@kvack.org>; Wed, 04 Dec 2024 03:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1733310680; x=1733915480; 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=7pv7uitRReKN+1XEtzxbevTSt67jmAqoi+0p+H++uGg=; b=K6PX0vHf7pAB0nWqyMgcCxLsjVPOXuUgBWW3qw61YJY1RXbPNmmkGqPwXwaE1HxjKL G9zf1S7D7UbvhgnV9bONHJmnKK6ugbDksflaJKNjXoxbEv3cBw45WwUcfQC4BHjvVruu JGAqBWeg5MQRsT/GXnu71/xVrNWOq2ZynnEo5x/6fAGLSSNTAYd1vm2HV8LCfBetjiQA Vi1/wdh3sUzRTjVPI7lqKCmAi4MDl1uyRru2X74oamWKDH8gfLtnH3FaXBfdTyN6H4D9 XfyimCHORbFRNvqASFgszP75xD1k3CPfAvWRibsTaUtug+s7ELi/TV2WVDJxWRLSLd19 80ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733310680; x=1733915480; 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=7pv7uitRReKN+1XEtzxbevTSt67jmAqoi+0p+H++uGg=; b=F39A0P0RxU4YsHOeqFg4EB9zDQhJZ7y6Q+xtJyrOATFG/D/XPO4Nx9PXMUY8mSwJoz XwbclIUO2ZkXQFsxh4HCQzkPcYngjheXuus8Fx3EhI8Yv9yNJ1Dwfx871yXlu+4LFWke 7JAFJsivXFs1gHTj7wF9Dn4err12ZpLBCmS51Vuk2A+C9KPkvLZk3jA27aWVhXXJiGVD GPkDaIO/0ZqbrXQRnSyRNe3xfyLxpDETSZgRxb8LmO0qFNV4gzg5oM/5rhaaWTacI3aN FH20CKRV6wlPjFIvGhbxk6rLldW8YupAy6zZ3C5ygby6Z4ba4I+LzVeQRXGkdcDZ5Q2n sOmw== X-Forwarded-Encrypted: i=1; AJvYcCUEuIso5P5ammVx0aPBi4A7ypIAwsCfmidUdqxnS9LC+RJ9Kw8PwaMWoSEKlQpSuu4sxgD3Vq5WaQ==@kvack.org X-Gm-Message-State: AOJu0Yyp8QjMMehLmiR7BC+/G4HGa4jz284Z3Tt3afq6bDtUigyeDylO K7omgC3iOw9CtNdjk3Lg0s/Ou/ILp4Pf/Cv6qQVld7BCJhoUcct8LDvkGg+mq0E= X-Gm-Gg: ASbGncuJUHE+JcuZKxbbz6blnjTJZ57ieEhM1fYWC0KUD/PEF32Py0F/iAwOJ9rX5+0 +gN+4WNsqT8Kz9boaXk+MQDnVVq31y5HB5IZUFQRpNr7oany+51aEuA4IjQroSpgCKK9EksmKhP qb/v44c6iJIel4FkAgI07hP3rGpJuacLL4NS9uPm6AdJf8BhQDyp1mqQ9Lq/J84nYZt4n9LdkH2 6Ga/doxFIr3NbgqJjuGYkeGzb8QDedBZGgTzUtrOHpwHmrP96ffD2xuQ+wb5T2zrZUMWpuH/G5z Mexix4oUsZRyiL4= X-Google-Smtp-Source: AGHT+IHbc9xNaqbbB+HahdZkvlcNVEtw+zco1U61JfjC0HrH8ZPfSYoGTbGPdGo4pnmKoLHl9UqICQ== X-Received: by 2002:a17:902:f712:b0:211:ff13:8652 with SMTP id d9443c01a7336-215d0050dfcmr58113365ad.28.1733310680194; Wed, 04 Dec 2024 03:11:20 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.148]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21527515731sm107447495ad.192.2024.12.04.03.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2024 03:11:19 -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, peterx@redhat.com, akpm@linux-foundation.org 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, zokeefe@google.com, rientjes@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng <zhengqi.arch@bytedance.com> Subject: [PATCH v4 08/11] mm: make zap_pte_range() handle full within-PMD range Date: Wed, 4 Dec 2024 19:09:48 +0800 Message-Id: <76c95ee641da7808cd66d642ab95841df4048295.1733305182.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <cover.1733305182.git.zhengqi.arch@bytedance.com> References: <cover.1733305182.git.zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 18417100015 X-Stat-Signature: xi4zposr4kz6g8ejt7jyiiw95nardp9a X-Rspam-User: X-HE-Tag: 1733310653-67748 X-HE-Meta: U2FsdGVkX1/pffpqY+w+uwuFX7tnBpra3D/MxNwz6mYWYKS04dZgROWMkpUlamM4Xuud2dwO73vfSyTQLKN7s+TmRV6FlShYuGHWEGEOXZo7CaicF/Dyo4jd1B1OEuPUWl0u0EfUG5S010GwVQm38iHsgiGOecCXhezt29b2zsjVkszJgolLIpawHKowMB7P8s3Erz/fXV9FppU9+hz6z21aCHVqDdnTxLa+IYIngJTNIWLimwxLtbiIvYvNQ+7sutVOcP+eAIiWSkWiyz7q6AWAul4LYU/ozflTwdGqlEY94WUwfygU2a51miZQHZJYYFZsyZ1O2E5tBm49f+f3H8KThwLoet4SagnKk+8xvSIo+eEZB9YGr8jRZgw6iwFrjNuBL26X5C8cI/AlKZUiV3QQbTx9I8wMGNH9QtsAMhkwMiPCI/A/SXG2rLvTlW8wnihQSFrurzbuLhFZzsj/pt+uwN+cTeFKuYS+izixENlNqY4uOGW9V0IiPC6KYNLREKbIgr6sHm/2aVph+MrxA5ItoieqixX3ZiD6qOngERvjDF+ql0EkAE18gOoUZW7nsZJvdPsukKoXHoYrgfj99DTVb3ZP8oiHED27VnNkUsr76m5WgA7iweoqg10zeDLJf3zgLVrDgAsWDcvvUbBXj61r/+nw57/vr9eUtDBIq/Ku858oLW4H/fw2rfW4/6art0rTSRoZRZI3KMDHftZG+/zqVO/TMryRmCIPGjZT34hgMCA9kA+H2/DHL8O5X8UpWwTQpUreZTe2jsdRx/dMh8rB/cnoiVEs+N8peEjhtwd7TbU+UaWS1bsFirWbFNEd74bgYfbMPBycwQ2MyJWnJrgPk0g2daZf6Ihhk4NmlEGNBIwwZ729fAzRML2p/fjTaQDNEjrEm6l44e6ZpOhQv/f5pHFw9K1dhffaoN37xkcTMaKHYxCnYNRql53pRYTt8WzY8o5vaPM0jjC38yO oXTp2j2r C9naPdn4dA96U0ofm1vz6OzTysARlcH38IonvOLd9g/sJB11IY6pcO6vz4OjVN13CxYcxgtDQLyt2BhSNSO23BFRbU1PGmw5rKX2gYOd9xiCEDLijUS6Fzgw520X1dB4rBhmnfYrogzwr016kaDMowA166saNFVJHhQ5Eg0HY/+ysCoZ7BG5IK+9jrqtq66+QxlIbS9gAwNnqCklHYaIrE5XNCp3kTsBgUL+Vy32NvFHDXpi1UsQ49CVyHpX7MME7eOVTkIXKFzrd1yD0NgZUwAc5iBRF1vqsPURJQbuHq1c5r8husjtOKT+UfcvzYWHdZcz86e/Lerbf40cdjDep3Ls93KZmRnnqUmKgflKo+tvauTg+vsCAzggeKPXJzCJJWWc/ 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 fdefa551d1250..36a59bea289d1 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1718,6 +1718,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); @@ -1757,6 +1758,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; }