From patchwork Thu Nov 18 18:11:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donghai Qiao X-Patchwork-Id: 12627463 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03442C433F5 for ; Thu, 18 Nov 2021 18:11:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1A1C6138F for ; Thu, 18 Nov 2021 18:11:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1A1C6138F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1CCA26B006C; Thu, 18 Nov 2021 13:11:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1554A6B0072; Thu, 18 Nov 2021 13:11:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0F5E6B0073; Thu, 18 Nov 2021 13:11:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id DBCDD6B006C for ; Thu, 18 Nov 2021 13:11:46 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9F2F48909E for ; Thu, 18 Nov 2021 18:11:36 +0000 (UTC) X-FDA: 78822843792.02.5058C18 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 425B3F0001C3 for ; Thu, 18 Nov 2021 18:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637259095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gtO9f9wMH7XMAgr69Sqq/ALOOvo4PzU6z/sVRo8aNSU=; b=FIOTKiJOev7kWamQFSRoxW/hJ3tFacJ1nRlEFgOqcehObcnPIaTtnzIV+vi8HYEYeBeiwm gf4OaK+f6TUmKYQT0Ed4jj4dMoXhIx3SB67dx0BAcs7EZ2gZSX0RqRanHDvyW2pHPE6S+w ++LYUEEJRHgOA2RLxbQIXW5P5x0jxfA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-465-ybRe6V3oPH678MpH4akbJA-1; Thu, 18 Nov 2021 13:11:32 -0500 X-MC-Unique: ybRe6V3oPH678MpH4akbJA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4F3F1006AA1; Thu, 18 Nov 2021 18:11:30 +0000 (UTC) Received: from dqiao.bos.com (unknown [10.22.10.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id C28F760BF1; Thu, 18 Nov 2021 18:11:29 +0000 (UTC) From: Donghai Qiao To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: mhocko@kernel.org, hannes@cmpxchg.org, guro@fb.com, dqiao@redhat.com Subject: [PATCH] mm/page_counter: remove an incorrect call to propagate_protected_usage() Date: Thu, 18 Nov 2021 13:11:25 -0500 Message-Id: <20211118181125.3918222-1-dqiao@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 425B3F0001C3 X-Stat-Signature: yqfi8khqmg3imutnogys45qszpj5i47k Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FIOTKiJO; spf=none (imf17.hostedemail.com: domain of dqiao@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=dqiao@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1637259096-302932 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: The function propagate_protected_usage() is called to propagate the usage change in the page_counter structure. But there is call to this function from page_counter_try_charge() when there is actually no usage change. Hence this call should be removed. Signed-off-by: Donghai Qiao Reviewed-by: Roman Gushchin --- mm/page_counter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/page_counter.c b/mm/page_counter.c index 7d83641eb86b..eb156ff5d603 100644 --- a/mm/page_counter.c +++ b/mm/page_counter.c @@ -120,7 +120,6 @@ bool page_counter_try_charge(struct page_counter *counter, new = atomic_long_add_return(nr_pages, &c->usage); if (new > c->max) { atomic_long_sub(nr_pages, &c->usage); - propagate_protected_usage(c, new); /* * This is racy, but we can live with some * inaccuracy in the failcnt which is only used