From patchwork Sat Dec 16 11:43:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 13495541 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 1DB83C46CCD for ; Sat, 16 Dec 2023 11:44:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76FA06B0089; Sat, 16 Dec 2023 06:44:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71EDA6B0093; Sat, 16 Dec 2023 06:44:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E65B6B0099; Sat, 16 Dec 2023 06:44:14 -0500 (EST) 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 4B3316B0089 for ; Sat, 16 Dec 2023 06:44:14 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 238A2A266D for ; Sat, 16 Dec 2023 11:44:14 +0000 (UTC) X-FDA: 81572498028.14.AD3D365 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf27.hostedemail.com (Postfix) with ESMTP id 7144A40002 for ; Sat, 16 Dec 2023 11:44:12 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EFswJqZh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of haokexin@gmail.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=haokexin@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702727052; 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:references:dkim-signature; bh=hpDvNNsQIz29Zic7uAfW6bMfh4cy26bxW3xcoELQhgg=; b=AfIDzlUrOPFVCY/PGS08faYYH+HMcJ1S0qkv58PPtFUo7KVW2uz9IFp3Wb5aVbRZ2Jl645 qM/4uenlM2SCLNv82rvBMGZfBitTxT+mIIWqjCtuL1vYmcrD9waP/jxmwCVUiSc9NcDRdk alcOc6OLgdwtSnTh1Mf+JwYnGt7TT1w= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EFswJqZh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of haokexin@gmail.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=haokexin@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702727052; a=rsa-sha256; cv=none; b=KaSkt2ctASEgagVqCJ9oI9wvnHedOm9Ka5wk0j/zbF1OjW68bac7CK0RVmUVBHOgjTbigS fMomqlIjsFzMb30oTKILlKYrHNn2yTmvwDtRKn6Ac8+TsozUCU5duKOdhKGsb1AzcPei4e Nu5W4+5MFLp37iKWkAwLgTaWHxcQle4= Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6cea2a38b48so1454751b3a.3 for ; Sat, 16 Dec 2023 03:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702727051; x=1703331851; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hpDvNNsQIz29Zic7uAfW6bMfh4cy26bxW3xcoELQhgg=; b=EFswJqZhvx6ab7incHFtm0oxIV3CHTE95RozzywPqJB87THE4U1QrwqFOsXOkpGnYD c21eIQgtWneK6eRzn4Ji0eKKptKfXAIeB/pBRVo02Gy9mt3d8kPn3R3Gb/PKX2OwAwtQ QV3AR0vsZCD0N4BUVE9ivhwn+Xo3V84NlYfxUKvy5TyipJcKhcezVmYYw3/FefLXUTPP lnhRLxq1k8fjDWU6MDb+wxx0Qfx+5QDXxdB8b1y3i27koEnuON6dICIn9EU3RKCfiBDG v0oHv8DZSAaAdOiIG3nCp//7LZttnXzOCji5NjIUr71dAqKoc8RNSOkgOJiC5Ft8kOIi iYhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702727051; x=1703331851; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hpDvNNsQIz29Zic7uAfW6bMfh4cy26bxW3xcoELQhgg=; b=nIIB8WpdIV5lRS5FaY07WzFCRy+9hQ6kq+fFLvGNbcWGsXGag8nEVTCHpUzYECaGHg OjHo22/6OejgkIS8kvkJQ/cOL1WLqE8YBbcpFOGpR9rJUg07Fnlic+QU/LFLg6ra4H4k oaovmE2C89gTY96QXbBPsBZbj9ILMEMl1dwgkeW/FLaFgzX+CqNK89gRHK8BajxLGSHf tVMzbM/rvObAkWN/dVJHlNwP+WohGeT0hwz3BAC5QjYzDSwtOo25+B6AAcypXnHH5wwH DBuOl24guIS4sTJT51zThHIzd8t5cJplcfzo72IhPXRz/8tfrIciZM/qiZUAcEFbLfmA UXHw== X-Gm-Message-State: AOJu0YxG4aG15bicyvEpi/Ge/YgtuiEn22p0uGhdfC/jmcVwgMjwHIsE CoovMPen3gRDHBGkhxezS5s= X-Google-Smtp-Source: AGHT+IELSfP1FOY8hZlXvWInMaPt7PUMrnjsq3kl//NqCR1v6rW9xcVk20Jrsj6q4C17qgrhLDiBLA== X-Received: by 2002:a05:6a00:1914:b0:6ce:e210:994 with SMTP id y20-20020a056a00191400b006cee2100994mr16176671pfi.7.1702727051205; Sat, 16 Dec 2023 03:44:11 -0800 (PST) Received: from pek-lpggp6.wrs.com (unknown-105-121.windriver.com. [147.11.105.121]) by smtp.gmail.com with ESMTPSA id a24-20020aa78658000000b006cbb5f2cbe0sm14916627pfo.102.2023.12.16.03.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 03:44:10 -0800 (PST) From: Kevin Hao To: Andrew Morton Cc: linux-mm@kvack.org, "Rafael J. Wysocki" , Pavel Machek Subject: [PATCH] mm/khugepaged: Remove unnecessary try_to_freeze() Date: Sat, 16 Dec 2023 19:43:41 +0800 Message-Id: <20231216114341.2281852-1-haokexin@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: we4gt5wghy8dd176trhbuyf1dm8k5d38 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7144A40002 X-HE-Tag: 1702727052-400182 X-HE-Meta: U2FsdGVkX1+puQ6Lan/9jaUWMRWZpBpLgdu8tpboCtxuiU2DX+CAOzsqfqcqFI4Qp///id3Ry8XIRsZW2J7xLfySUEtU14+XSSWecJbPJky/OHUE1RuDWNwllcurdip9o9ACvSCwUSvUqjSGmtc7g9hzt1nOG8Y44aL3HINF4Li3r1/64qJEjwFOEUYyhsqtQVWHdO5xpzoSZl1zvdOCky3MNyJwh6DZmIceEVyD/uBk41j4z3l16Plb09dn2UcSxEDOxrjyfFg21bGOZ9JVGx0eiqvyY9MRK613VOeGBDH8aJiFimiVyRkJl/RvgfESMP3MQAU5z50Kxj6VJrRZwrSs2QqmjDIFETNZdUqKcL5nCzFmBjU7fHVRFDlE4sQbD3XoLec+jzmGsg0Orq5l+KiqeqR4vRdxulK5PG6cDhim8bV0XZbZMX8kE8k/SidGkiEcOKGBiqn7ypKfNnLqSkU9PCVHjmlTLQFbBHvnWiXVPoi+cJv3N13fNuWQKBZpa7gSAFiWdTU5hGo7xLCrEcXr5rvTufrs2zj8vCH6Fz1Po1ZguznTB9lN+cZ5DPQFFwtOzbd8x/6rjK8IE3KPVkCeg6tfQXb/r31ZOSxMxpbZx+U3y0isuRX4r9LV5zUiIG7tsHAsAen9sfdPf2v+PzZtqvhVq/Rp1ZQzziBZXkbM8ZTcmuExHr7fwA4zvckgorZbZimoByZzJd7jmhYwC1tHlAQIT1NwPx07BFVTdhMcZ4RGTsDMcDreUzoVvc1I/QZfTLIg7FCDoYsHp1i9xrjorwpvDm1HBA4PV6t9kX1igbBBpdrTjM3wyJvmHiwd2GGqY3M09bXiTagR2SYLSNR2HzGOXX/urlam9n9aFYfk8MhphTO3eo0PBz1LmFyy5J2XxRSvJ88oKrqkm1gBN8BSG9wyPyp1EhaOhlMNWHBq7K+LyKQWf4szGOBQASZyqdUn9+IDZPwXTl/L+pb xdWrVCg3 l+83Pwd5z/cX6VDB9OwU1eKye0sdABlpv2KwhRM1fDR+ydijlVRfT89kCvk5aWCUy32vyX36FLM8yFGtQnKXjGP0+dfkaYvtKkjWnRoWG9sc+2Vw++cP/yP7vUq5Fnvn6kDVu7v3Gtylixhtnrx5qiSw68pz8qlMfeXxwNJDNuErYmL4UEP5OkuzfVT7NHrVxuTX3CO9CZHl1Dvf72D1uSXDGFS26QhdA1tpb4h1FJwDcZUMPmHU9qUDQmmAkHeUxS2YnwvTaGdZiQKTMhaJOYOoNpHbJvVroTifmreJ310Ucms6p4csZazttDxbpU6uIDle/+Ak3c46y+PFsvKbUtKPQBnqATXPrLIJUiaskErGkxsz4ZlT8c3tUXeSDcn4qImBMFPJKwy1sNkqkjDnD5NXbMA9lgIXGqQVj64PmEjWZEKNSugceWqQo1eqnJFvC2EAhb4H90vipk0316zny0Pdo9if0qHfuJ7edQg81Sf84xAY= 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: List-Subscribe: List-Unsubscribe: A freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. However, there is no need to use both methods simultaneously. The freezable wait variants have been used in khugepaged_wait_work() and khugepaged_alloc_sleep(), so remove this unnecessary try_to_freeze(). Signed-off-by: Kevin Hao --- mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 1002e9156388..9cdea59fb4c0 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2499,7 +2499,7 @@ static void khugepaged_do_scan(struct collapse_control *cc) while (true) { cond_resched(); - if (unlikely(kthread_should_stop() || try_to_freeze())) + if (unlikely(kthread_should_stop())) break; spin_lock(&khugepaged_mm_lock);