From patchwork Tue Feb 28 21:37:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13155251 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 E7AEAC64EC4 for ; Tue, 28 Feb 2023 21:38:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 462456B009B; Tue, 28 Feb 2023 16:37:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 300D16B009A; Tue, 28 Feb 2023 16:37:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C7756B009B; Tue, 28 Feb 2023 16:37:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0571B6B0099 for ; Tue, 28 Feb 2023 16:37:55 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id CE9D6A0D7F for ; Tue, 28 Feb 2023 21:37:54 +0000 (UTC) X-FDA: 80518013268.16.BEF0B15 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 26B35100010 for ; Tue, 28 Feb 2023 21:37:52 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OD1wQ9FR; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677620273; 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:in-reply-to:references:references:dkim-signature; bh=Yzj6cO2/vJ4MfYZK59aIBqu3Kv7SFJ8gH5oZ5flVgEs=; b=HcZaeUFZa6UrSIMId4l8ZcStpoP9ZHJwHtHEDX8I366qrIawMqHgFdCuXlLIoyPf1wZCrS 1NngcIcm+T1nLzegh97SIAEFgVf8gOPRoIursfZdpaJ0NHPFIDmy/vazWLs6TgjKEkbzer 0UoTxgqim6MilYzcu1SP5Ht6zuFDpM0= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OD1wQ9FR; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677620273; a=rsa-sha256; cv=none; b=qY5Y79Cf+F17rjxx931O6Evez93sYaHfF7HsTAzCSmXF9C97ZMcigHvGgRagfrYIXpmoxk YfdqAYysi1bgGsgCCCL/VJ4cpcfD+Vyjq8n/xlC+/LreqU40HzNbslHMoD6Dba8a3Xynkk Sv28cdnR9wDFE+ikURe/bSf7k5wDFu0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Yzj6cO2/vJ4MfYZK59aIBqu3Kv7SFJ8gH5oZ5flVgEs=; b=OD1wQ9FRkxcghMLJg6Ce5C0ga2 cmeah8bBnDlnApT7w9eP4jLoOHWe5LOWJvaXjzySJToJ/ri5lFa/WPRrYlKCBfTnoTOy61IeVDPmi 68qgaO505JobxikfyskgY9xbNje+JqFPUysl0cnN+vEVR3pgREX8J89OLKMHl/TqyyAVjEpnol4zA mWNvomzEhL2O9QcgO/0OOrJvu8ccybEFryAof/kx97tzFyUluCPOeKa3/0cjX3UTPkb/j9069P53J +Cg4IG3uFwzyjrZHabcHWuf84tIb4VxnYUxvHW0kGOEgevnxc29eSy5Y6qNTUzaF2UnG761WUlGH0 nbiy8g/A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX7fL-0018qr-6O; Tue, 28 Feb 2023 21:37:43 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, linux-arch@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH v3 30/34] mm: Use flush_icache_pages() in do_set_pmd() Date: Tue, 28 Feb 2023 21:37:33 +0000 Message-Id: <20230228213738.272178-31-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230228213738.272178-1-willy@infradead.org> References: <20230228213738.272178-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 26B35100010 X-Stat-Signature: ccfykspoykknqam71f6p191jof3iahgh X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1677620272-619896 X-HE-Meta: U2FsdGVkX1+/aW4IkReV6VJQzVoVLXh9Jy08sH9J4eOoDD986wH07jeYl71gwGSVDkZ5Yw2aJs2XvBgO2LEU+C0iX3rkzJxfYSqw4gBkMm+TGLp4/KeqAg95UwLzcLTEoguEBEzTmKfj5Uc0Mtq/0mtq+t2K5pmxi6jDvNMYTauj5NGFB/cxxUCE6j9eSFtFIoFCVjba/BgJEpT8OFZfJNKivDRpiPIyiAYbsicoVfPVD3HwLALTnAZ3iMMwgOnBqN/4FSJsSEI6igLg2o5IG5MgBHmKrJNJffxV0z2xI+XnGowwlDL5mSoE6gP0QOpH8Ht3dMtvchMKfCIokdKzLUgGg/9iPKoPFfuBHXA7vj5+THkGpSaJ/XIslo9fpfn3b8ctSAv3aPIgaLW//za4QRjxw2oC08n5OxozkLczV2YjMbYwcGd1BAHl1lfKpiZwRVToBVpfsyYyROBduqG/OI1huFk3phd+KfkZR77/6EU02s7Tvjh6QnMwbkrSd9J1vGtBr/M4jg5EGRFzmnootxLN4H79oTxPMobihn75M1uosNgY7GJqck4cteKYaXxuf4vJ1ABdrSoI79ReumJo3IebFV9xngEvWToSzubm4pm2tVXNCWzMqQ5oKbYexNBoO6Of5GxV/97lArZtvk3NpCuIvZM4nb6w79vLGhxJjjNAnCrKLjaH1LynCCSijgFLviU2XTgj8XP+FXa/5UzkKyRoxJ9ogq8UI1lbjvdt81B/5QFSeSbOXCjIyx338OhiT6fsbeKw2gGvyOq9Ky8uVNn21GIYWTNHNgZtniA5iOV4IbWqBGUrKJ9Y2H1T7SCZRI67jRao+fCSRR6Xv5Ff56eVZ7c/KhUGQHA5dXgoknK+ZayStEsj2tWdsfFdYqkusNFcxBuvap99AH5lS+J2h689/j8NKaANOEyb9bRFaPIT2Y/cjsyajPmAqqrU+sKWUhjvDN4CxNWhCqKE+Xj xf/beW8y klhaReWH0I9pSxFl9jRDP9uN+B3fShGhM0zD5fG1xuZPRFCR8SoBWFxJssaiG9Jpi0bokJjAv5K6L74zuLIjEgTo8Av6LguNCOs86LvHz3QpbDIK+VXl0o2/rEB+AcXRbDfqrWnODEf1Ft+wI6GnMk8F3IaInGASrghgZ55x9PDPNLJqJCoIklaDdGYmKU3h4xsh24GZdmlOyyO6Bh3n2X3tRylDxqmr6F7kHaSWFoK8EnNjkNUV1EBo3Zrp7/eYdJTjJyq3rhRw17t0ZoWDpW1DLzg== 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: Push the iteration over each page down to the architectures (many can flush the entire THP without iteration). Signed-off-by: Matthew Wilcox (Oracle) --- mm/memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index bfa3100ec5a3..69e844d5f75c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4222,8 +4222,7 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page) if (unlikely(!pmd_none(*vmf->pmd))) goto out; - for (i = 0; i < HPAGE_PMD_NR; i++) - flush_icache_page(vma, page + i); + flush_icache_pages(vma, page, HPAGE_PMD_NR); entry = mk_huge_pmd(page, vma->vm_page_prot); if (write)