Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp113603rwb; Wed, 21 Sep 2022 18:33:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vQ4AZnb8Pz5OUhvBDaomlJG/NmcZ16p7HCKsmlmVptd3d5NSjTWLKVZs6Wo2BmbWV1H1Q X-Received: by 2002:aa7:d695:0:b0:452:e75e:5073 with SMTP id d21-20020aa7d695000000b00452e75e5073mr864177edr.338.1663810401275; Wed, 21 Sep 2022 18:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663810401; cv=none; d=google.com; s=arc-20160816; b=mlUNDLZTQdmjaXqKMV2SC6uaLFe+ZpYis6LdSfRwBigQZ6Snya9NMPqCtYQkP77OTg yqti2tqqMx2nXTuJmseTXyaHAAYC7sQlKW1ycPMVY9PDHJjyDYRpqZEkDgCIMW1H0QWJ KAKqy8uzHBSAhK1M2A7hBnPjeFMSrrgM3ayJbsqVndJw4TGnIcnNYngiyzRtq2XrXnsq xhQ5aw+ykjWzIh+FofVWYC+v9uKNAxSyzUgHDfin4Fh41NWRItloUy48nOM4F8hzjF/z 8CCKViyQVYpKX9zVbCrUQOvJyJbf7HH42TjegKgCXEdePfbp/h0QepnA9ihyuBi3b8/+ l1IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=qknF5tcmy+B2CeTlFoEm9W1xIUxKlOolFzMt14jmfpk=; b=fULk5SyUF8eh90c3NYPsQc5FMAvRBFUN/0F9PfDXtxc8+IZt+GOo3Djq2XIAm0RP8S ZJKrvs24JFTOB/GJ694sx46Qd09qeEUUr6HBZ0mu0ITrUUK7sz1u5RNWe0od+PVJIFtS vjyiUy09CyxQKuUSF5rmQiOPVn6PUjY3z19D0sKre930aWIlOZpqGvmBx9HJc0nNyoY/ 1McSqBXsx33QhVrH4n83mXn/hIFK+6xnitACATCXXSQYl90T3fke1I6w1ZmHBfzyH/lG mXeBLTmjlFzQ1lypI1vzu8ujt77b8U9ocUHhwYyl2v1ZZChukr4gXDiXkxTS/yQTAmN0 kfNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm2 header.b=X2bHIeLY; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Mk7vLLrc; 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=NONE dis=NONE) header.from=sent.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a05640235d000b0044e78dbb615si4396912edc.379.2022.09.21.18.32.55; Wed, 21 Sep 2022 18:33:21 -0700 (PDT) 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=@sent.com header.s=fm2 header.b=X2bHIeLY; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Mk7vLLrc; 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=NONE dis=NONE) header.from=sent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbiIVBNS (ORCPT + 99 others); Wed, 21 Sep 2022 21:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiIVBNC (ORCPT ); Wed, 21 Sep 2022 21:13:02 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 038C94CA09 for ; Wed, 21 Sep 2022 18:13:01 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 94EF55C0151; Wed, 21 Sep 2022 21:12:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 21 Sep 2022 21:12:59 -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=fm2; t=1663809179; x= 1663895579; bh=qknF5tcmy+B2CeTlFoEm9W1xIUxKlOolFzMt14jmfpk=; b=X 2bHIeLYGPhTCPgQDwNnhPXIt7MWjcmMCp5OZlT5Mkm1hwHTtIYOmhhbvBieCR2yv q3SIY3EojmIMybIMbpb2TbtdtHpVmAqudy1+WlKTAhPVj+ID2hiclyag1lu/20ZH 7uHC/UM84HyHFhP7ynvU21zoJ6I3LRzuQ4PtCVKEGH06hM93mc9d9Gd9WYZ7CuIe WXlQUwqxKDZjl1BG4x2M114vZ2zfvcs1LDkLhzDirl+qFkSEsHybRnJDpDlSxaFD waoQM8AM5KSyj4asoHtK4OqmtjaY2pS54OBbBP6Q5x7FM+szqG5zo7YA8wObOG8s T3rQEqILXpkiz/nglpygg== 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=fm2; t=1663809179; x=1663895579; bh=q knF5tcmy+B2CeTlFoEm9W1xIUxKlOolFzMt14jmfpk=; b=Mk7vLLrcqb21dqzZS mmBHP6QqHTSiDjdqwagKJmEE+MDzrCh/m1bOcoJqTg4rm5jSgxOoWwHynF8QRfhY 05Bw4XyuEEscpaGL26H3lyMmqa3aATo5Q+jEypMQQh2QgYhgWx23C4h2DiR9b5uu 8jz2JW2gKKuEXz6qVRcOTVzJ6D0cd4584SY7Qwnx+NO4HYVtPOQe90HK9HO++8AU ADkUgyFMJg4XozOd1dWNNP1jTlrCWkkKBr4J7e4M/uBG6wkybp4n+y04I85ERQ3l onFNvIy7Vh6iUyxKD+MYI7uGfihdCGLDHD9bE11uEevG7TyHELtqNw+rUWM1UxxM 1Jr4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefvddggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeegge ehudfgudduvdelheehteegledtteeiveeuhfffveekhfevueefieeijeegvdenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Sep 2022 21:12:57 -0400 (EDT) From: Zi Yan To: linux-mm@kvack.org Cc: Zi Yan , David Hildenbrand , Matthew Wilcox , Vlastimil Babka , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Yang Shi , David Rientjes , James Houghton , Mike Rapoport , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH v1 05/12] fs: proc: use pageblock_nr_pages for reschedule period in read_kcore() Date: Wed, 21 Sep 2022 21:12:45 -0400 Message-Id: <20220922011252.2266780-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220922011252.2266780-1-zi.yan@sent.com> References: <20220922011252.2266780-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 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. Reviewed-by: David Hildenbrand 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 --- 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) } } =20 - if (page_offline_frozen++ % MAX_ORDER_NR_PAGES =3D=3D 0) { + if (page_offline_frozen++ % pageblock_nr_pages =3D=3D 0) { page_offline_thaw(); cond_resched(); page_offline_freeze(); --=20 2.35.1