Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3110691lqo; Tue, 14 May 2024 22:58:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPus0iS7y3clEJaiIPzdYiyF2AYui3E5R7NA5CTGETFAKzRWp8d/sC1Z7+U09Vmgu6BRD8kslh6P+gjXl9S6Lr6K/sVN30fItKxhT2xw== X-Google-Smtp-Source: AGHT+IG3qF8JRB1KqGdm9L2z9Dmlcaf20tqrCRKdLmFyGyEQj4P+V/VGmZHCA/bqoDYzwDdqgz7Q X-Received: by 2002:a81:4fcb:0:b0:615:19db:8ed1 with SMTP id 00721157ae682-622afff0014mr134181487b3.48.1715752734398; Tue, 14 May 2024 22:58:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715752734; cv=pass; d=google.com; s=arc-20160816; b=KqRDSuS/hTVElvwc2Ks7x6d68dDC/ZYrArSZnRRRs5SZpc3WaKeJFTvM9pPFGQoQeQ GZaNg/tD9/iDt51MF4eC3Dubmf1bY0NK0QFRzh/QrCHVIqTPQF+hm+YGYI5ceeu+xmKV w6mQvwzt7XoSiHp4dYfQnb2++eI6nudzc9dXxdCsXqqOGyPS++pfIAv19wv/jVI3vDDI mPfhV8Xpjz6jJ2I0o8Cv9FjJf3cCZF7gtlmw9mDeA1o/0k1uhctnMnq32KlMiyS0aFRK JMJCbkUGFGw/ZlR26KO1HD+5Q2gEvh0K3e/UdQs0Mf33IQ1OSH3IX/ZhPSpOtZdevHVB z1Ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:content-transfer-encoding:content-language :accept-language:in-reply-to:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=LR6zBAqCV5AW0imgsMiCR7+GSDVrb77Uvzm1KnB3t5Q=; fh=boE2T1tfXWhPiAXKUEd+pJodvJpwHMz3xvNd2cVdM48=; b=mAN79lQVv/uyT3kxT/oJPf1z0AUNYg4wFw3NCNq8iMyzg/ZnzontA19gBmrcl1v58I jdkQaUhRXvFNc2tFcfZookUtKn571eYQuCBGTw+i5TFWUYzhLec8tWaETfM4HryKENYf 2FISwIB8BDJ1ctFpBlC1h3gBIDBYivpePYC708US0kjx3hiJFK/U8O4f0FTogx9XydH4 ofVGiOlpfLUmB8O7T0aWPSbnyaqHT8XmDtgkO3ZEu7Mjx2GN7pew9IGlFvBra6s6PYzl XNGfFP/q7BAyTcZ7X5o1CASpTTQLPMV/xBNZy9vuaqo4j+NTO6CkKUEYLZZ9F/XgUKKN utog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u4gdewf9; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-179487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179487-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df56d3d41si122601061cf.677.2024.05.14.22.58.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 22:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u4gdewf9; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-179487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179487-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 039071C21DE3 for ; Wed, 15 May 2024 05:58:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D5023E470; Wed, 15 May 2024 05:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="u4gdewf9" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB2AC3C068 for ; Wed, 15 May 2024 05:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752655; cv=none; b=W5I0O1HuWEVtXk76rWwIurQt+DbRD6mJ1XTYrkD/rjuDVHq5fgY1uQ0EUZs4OPooyyswV5m32dciJLCYftFSTYccvs7DNQfj5ryNepWfJ4zJjMqgWG4Lm2pvdwj0sLMV1Ib1uWjnz+MiUryZIPhWGhv0Qm2HgStY5KXKs9MRJYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715752655; c=relaxed/simple; bh=nKWtereSLnu+oADE1O/ufkjOx3uZ4D3VDRJRS1eEsrU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:Content-Type: MIME-Version:References; b=krdVmM4VFGPSn+CsHVDwmrC1OyWxBeiKiLNeRGI2HTTr3a0elyafmWBH6TwFdd50zA1jpLdLNoSTCuIlivk+XEPR1Wks7sYYGG5bD4F+1PCSqH3hxhmuj1c7Y/sMHmhtYHNVNI4sXtYyFQbazYt2PgdUrFvdnobPoUfHM56PwkE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=u4gdewf9; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240515055730euoutp017adba609559e36d50a33eb7eb0dd88b1~Pk-HoBm7c1532215322euoutp01S for ; Wed, 15 May 2024 05:57:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240515055730euoutp017adba609559e36d50a33eb7eb0dd88b1~Pk-HoBm7c1532215322euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1715752650; bh=LR6zBAqCV5AW0imgsMiCR7+GSDVrb77Uvzm1KnB3t5Q=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=u4gdewf9aJ1/hhtGBiE/AmTK+E5NWKJWqtb2PRSlRy83TSAxt4f3BpHcof9oHbueN MzhWqh/cQJSDFsGv8sy8w4ztloQ2ME+6LaNnRwvwsRd6kpdoAxXP4czSSaz95blMV0 +IyiWcyKqbhQsY6Q5tpyQPHYqJ/qj4t9yFEv2zHE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240515055729eucas1p1783caa60b5809909e5f5f02340a8b5e9~Pk-HRYZK_2872228722eucas1p1g; Wed, 15 May 2024 05:57:29 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BB.BC.09624.9CE44466; Wed, 15 May 2024 06:57:29 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240515055729eucas1p14e953424ad39bbb923c64163b1bbd4b3~Pk-Gop9GA2569725697eucas1p19; Wed, 15 May 2024 05:57:29 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240515055729eusmtrp1fe48c4be7bfa2cd516577c63c5d4fcec~Pk-GoCb900390703907eusmtrp15; Wed, 15 May 2024 05:57:29 +0000 (GMT) X-AuditID: cbfec7f2-bfbff70000002598-56-66444ec9e21e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 4C.16.08810.9CE44466; Wed, 15 May 2024 06:57:29 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240515055728eusmtip16c7550411a40722fd434edbb57cdb6d4~Pk-GdPs9a0562305623eusmtip1T; Wed, 15 May 2024 05:57:28 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 May 2024 06:57:28 +0100 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Wed, 15 May 2024 06:57:28 +0100 From: Daniel Gomez To: "hughd@google.com" , "akpm@linux-foundation.org" , "willy@infradead.org" , "jack@suse.cz" , "mcgrof@kernel.org" CC: "linux-mm@kvack.org" , "linux-xfs@vger.kernel.org" , "djwong@kernel.org" , "Pankaj Raghav" , "dagmcr@gmail.com" , "yosryahmed@google.com" , "baolin.wang@linux.alibaba.com" , "ritesh.list@gmail.com" , "lsf-pc@lists.linux-foundation.org" , "david@redhat.com" , "chandan.babu@oracle.com" , "linux-kernel@vger.kernel.org" , "brauner@kernel.org" , Daniel Gomez Subject: [PATCH 05/12] shmem: clear_highpage() if block is not uptodate Thread-Topic: [PATCH 05/12] shmem: clear_highpage() if block is not uptodate Thread-Index: AQHapozEyRWHtpwfgE2CvOQjrDJhgA== Date: Wed, 15 May 2024 05:57:28 +0000 Message-ID: <20240515055719.32577-6-da.gomez@samsung.com> In-Reply-To: <20240515055719.32577-1-da.gomez@samsung.com> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEKsWRmVeSWpSXmKPExsWy7djPc7on/VzSDJrmGlrMWb+GzeL/3mOM Fq8Pf2K0uHRUzuJs3282i6/rfzFbXH7CZ/H0Ux+LxezpzUwWl3fNYbO4t+Y/q8WuPzvYLfa9 3stscWPCU0aLg6c62C1+/wDKbt8V6SDosXPWXXaPBZtKPTav0PLYtKqTzWPTp0nsHidm/Gbx 2PnQ0mPyjeWMHh+f3mLxeL/vKpvHmQVH2D0+b5IL4InisklJzcksSy3St0vgyph04zxbwVa2 ireXO5gaGBewdjFyckgImEjcvjydrYuRi0NIYAWjxJX5x5lBEkICXxglLswKhUh8ZpQ4s2om G0zH6rWPoTqWM0pcunKRFa7qXet+Joj2M0CZk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1p14e953424ad39bbb923c64163b1bbd4b3 X-Msg-Generator: CA X-RootMTR: 20240515055729eucas1p14e953424ad39bbb923c64163b1bbd4b3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240515055729eucas1p14e953424ad39bbb923c64163b1bbd4b3 References: <20240515055719.32577-1-da.gomez@samsung.com> clear_highpage() is called for all the subpages (blocks) in a large folio when the folio is not uptodate. Do clear the subpages only when they are not uptodate. Signed-off-by: Daniel Gomez --- mm/shmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 69f3b98fdf7c..04992010225f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2256,7 +2256,8 @@ static int shmem_get_folio_gfp(struct inode *inode, p= goff_t index, long i, n =3D folio_nr_pages(folio); =20 for (i =3D 0; i < n; i++) - clear_highpage(folio_page(folio, i)); + if (!shmem_is_block_uptodate(folio, i)) + clear_highpage(folio_page(folio, i)); flush_dcache_folio(folio); shmem_set_range_uptodate(folio, 0, folio_size(folio)); } --=20 2.43.0