From patchwork Thu Aug 11 23:16:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 12941801 Return-Path: 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 E8F42C282E7 for ; Thu, 11 Aug 2022 23:16:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 737688E0003; Thu, 11 Aug 2022 19:16:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E66F8E0006; Thu, 11 Aug 2022 19:16:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E37C8E0003; Thu, 11 Aug 2022 19:16:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1CEF38E0007 for ; Thu, 11 Aug 2022 19:16:50 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id EB0621A192D for ; Thu, 11 Aug 2022 23:16:49 +0000 (UTC) X-FDA: 79788873738.03.DBBB64D Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by imf22.hostedemail.com (Postfix) with ESMTP id 9B6FFC0156 for ; Thu, 11 Aug 2022 23:16:49 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 476FF5C016D; Thu, 11 Aug 2022 19:16:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 11 Aug 2022 19:16:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to :reply-to:sender:subject:subject:to:to; s=fm1; t=1660259809; x= 1660346209; bh=tt6jId4iDxONEi40HuzS8jeXRqOseXM3BtI6NV+Ndgc=; b=W Tgbgmg7N1ETpGczX0PYaZkoekKvHlvQP6u/5NV4zNueSNzesxv53I7Kin6hB3SjX x82du9nZlp3uY9i6l79aj4wYlZtyFiqdgyN0N4UrdV44xKEtU+bTbAsiU2AMC9RB WtLrQZfDN3Tu7oW6G25rkWVc3EFolHXzwAjGBVi0pZLQDDIjwdo2mNHHMF7OJjjt cWQpw7Nb482VaSwyCIYrrxSp5Lk0610xWfpZwZWm0k1gzNm9/CNYKPFUf9fM7ZU1 UpDfsBQY9K+Posy/7o5b+BwNwnY0aVh68SOB+A8Gg71g+xGWUtveD90NDpxoltZM wVeqrM/c8yl1c/kQQyhsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1660259809; x=1660346209; bh=t t6jId4iDxONEi40HuzS8jeXRqOseXM3BtI6NV+Ndgc=; b=R8BJEVgGcUJVB2sgf MCpg0SHu4nrjsCt/2RI+W2OoP5UnYmK4wNWmkU3XEsYAHoDps02pSz+PL1sn1efK 0ha62gCDXQ3yirK31sE/jQRWeVWxEuzR4/p1tLb1HY4MkSOmeLoEcKPfeIpCfx1N wnlChwVf+szOFJTZsA8HPb+Z1PHitKSzCp5lZvpzbvQOOhe3aDOvqyUc43gS95d4 YkAuxI/0tiuy/DtoKlA6LEvp09406HWyz2+QMOkNmRXyhuGzJamKmnTiHPTWPmL6 2i+OtpUnzYhAzyMMNWYKwctnj7a6lhlKMue6xp4dXx4UYKwwAIfGftTeBlwzYvMh DnQJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeghedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeegge ehudfgudduvdelheehteegledtteeiveeuhfffveekhfevueefieeijeegvdenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Aug 2022 19:16:48 -0400 (EDT) From: Zi Yan To: linux-mm@kvack.org Cc: David Hildenbrand , Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Yang Shi , David Rientjes , James Houghton , Mike Rapoport , linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 06/12] fs: proc: use pageblock_nr_pages for reschedule period in read_kcore() Date: Thu, 11 Aug 2022 19:16:37 -0400 Message-Id: <20220811231643.1012912-7-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220811231643.1012912-1-zi.yan@sent.com> References: <20220811231643.1012912-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660259809; h=from:from:sender:reply-to: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=tt6jId4iDxONEi40HuzS8jeXRqOseXM3BtI6NV+Ndgc=; b=lVLDBJOpmYVvbFANPdirkyKj17YpqImqseq9ItnVt8VQfNXaEtyhXkT2h62YKXHima2wyT V+YfYuAMfSPWbWjfcgF+BlCuMktullGfpHBeQVr/+ZR0h6XD28Cv0YjhI1HxDIL1R9VBW1 Idg6Zhj/gMRJRbBzsyzcU+qTrLnsieE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b="W Tgbgmg"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=R8BJEVgG; spf=pass (imf22.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.28 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660259809; a=rsa-sha256; cv=none; b=EFE1fn0Iq2Fc0U0p6/iDTmGn5yDvHzQMfZhe22ZPiIIkV+i0mOmUthfdpBfvrFH0HeLhQS LuVuv8s6teP8AQ+2GYnZLqsPndFtha1N7gNGQGgKwDkicStyZ4wcSgffSs63qRMNsY30dd X9pd2/xc2h79xRhpGoGpY1rj9isArWc= X-Stat-Signature: bmha3yntbzrr7emdxqrfo3j3zrgomtku X-Rspamd-Queue-Id: 9B6FFC0156 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=sent.com header.s=fm1 header.b="W Tgbgmg"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=R8BJEVgG; spf=pass (imf22.hostedemail.com: domain of zi.yan@sent.com designates 66.111.4.28 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1660259809-952588 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: From: Zi Yan MAX_ORDER_NR_PAGES can be increased when it becomes a boot time parameter in later commits. To make sure read_kcore() reschedule its work in a constant period, use pageblock_nr_pages instead for reschedule period, since pageblock_nr_pages is a constant and either the same or half of MAX_ORDER_NR_PAGES. Signed-off-by: Zi Yan Cc: Mike Rapoport Cc: David Hildenbrand Cc: Oscar Salvador Cc: Ying Chen Cc: Feng Zhou Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Reviewed-by: David Hildenbrand --- fs/proc/kcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index dff921f7ca33..7dc09d211b48 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -491,7 +491,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) } } - if (page_offline_frozen++ % MAX_ORDER_NR_PAGES == 0) { + if (page_offline_frozen++ % pageblock_nr_pages == 0) { page_offline_thaw(); cond_resched(); page_offline_freeze();