From patchwork Tue Dec 10 02:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 13900716 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 BD3A7E7717D for ; Tue, 10 Dec 2024 02:42:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 107198D0005; Mon, 9 Dec 2024 21:41:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 090C28D0001; Mon, 9 Dec 2024 21:41:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFF1C8D0005; Mon, 9 Dec 2024 21:41:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B9CF18D0001 for ; Mon, 9 Dec 2024 21:41:55 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7FDEA120263 for ; Tue, 10 Dec 2024 02:41:55 +0000 (UTC) X-FDA: 82877498592.13.673E63C Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf14.hostedemail.com (Postfix) with ESMTP id 2B062100011 for ; Tue, 10 Dec 2024 02:41:29 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=uIznGrYJ; spf=pass (imf14.hostedemail.com: domain of 3cKpXZwsKCGUNDOHVKVLQJKJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--kaleshsingh.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3cKpXZwsKCGUNDOHVKVLQJKJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--kaleshsingh.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733798499; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PpJ3voZ2zpkCxNiGYJ7mZV4beiWEDuh5gW+cJghhtIw=; b=4rYSvTeEZtmsLtMSqY1rJb0ZAOvkfsvvZgGHqbd2KFHBKh2igK3h+zgBdC+/alEsNsTbV1 08Dy3470zOFQ+KMi1bEgt4CK/C5AsTOhYvWlWSyuXI4CZy1QSzFWVQfvUJ01Gtx9e+IYV7 0PLPmMqU7Q/wG9siH0wxD3qeaQqGShw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733798499; a=rsa-sha256; cv=none; b=ZiSDaflIe75rU2hk81ubbG4KDHjC7dZA4ieTkgHLPa+gM//Urr6KydgvGXYIe7/ThgNNXe t51s99lf9x8sPzS5uy2hkSZCa05/iDfqYRmTpUereGReYf7hqrhUE35Ol4nhiPRcnUCzF9 e4S2O4cJ/s6vcObpmbZ2Fq08n2PhTu8= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=uIznGrYJ; spf=pass (imf14.hostedemail.com: domain of 3cKpXZwsKCGUNDOHVKVLQJKJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--kaleshsingh.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3cKpXZwsKCGUNDOHVKVLQJKJRRJOH.FRPOLQXa-PPNYDFN.RUJ@flex--kaleshsingh.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-725eff499c0so1234828b3a.2 for ; Mon, 09 Dec 2024 18:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1733798512; x=1734403312; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=PpJ3voZ2zpkCxNiGYJ7mZV4beiWEDuh5gW+cJghhtIw=; b=uIznGrYJgaTxBWI8d7SmwwdTtzpoihl80GF+Jg8paOyBqwywqq231mJMmIxjOE/IaU Hg22oz9o5Wj+Rcu2YQ0LrO8yzBCklmGTzW5am1PJV1Qj8o0Afb9r1WCRBqx0K5jGC00r VqRkfqVTTcAtYO1U1PkTsHaL93s7gq9DXdTJxC4gkFW/oPFSpevVhWQ2ZFzGbLSreQFO T1dn7rxCqgPvPhqrM0gOij3FbO8QOdQqJLKGWZidaF/CAOMNhQ+f2gR3LBKr3OgSUf6R tu/6FgpavR8erGd4meHclBQi+31ttLiEmCeVCv0Iz+1AK11eRtld7sBg0sdYJKzAWh94 KFvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733798512; x=1734403312; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PpJ3voZ2zpkCxNiGYJ7mZV4beiWEDuh5gW+cJghhtIw=; b=hXh8xg1HBR8ygY62GqTt+tzmO0LryRlsVJQncu6e0F3oE8zkkVsomV+/lUzCJRv37J 25N5MzHRX7oxWa17bGwjPAuTLAhyvv6ZAK8RZehHKmCrmvwuqVW4eRLylhA1AKOqSFl9 gY/hner+OR60rXUh8RgnieAjKsxxB+Ucj2V2Llht2AhxmXY2cXXBCt//0tybAQkoQRue 5CpY52YhIfNud6hWYmiUxblhcHQpS3R0UOO9lq/MVKlJuMFKw1zo0qNZ4xLiI2+ZSQ18 PFOx+CchRlMuf3uV/8fugc7xp0TGsFAAP0W3Fv5zkBgr5BQFnYdsZ9mDBlkNlQYLwljZ wpGg== X-Forwarded-Encrypted: i=1; AJvYcCVR7Ohqw6FTM6Z6YhEGpDiu8TYYRZKY1mDkMR/X1X7t3ax4Gc+1a/C0QqWMCEzm/p2XI5rAKtvN9A==@kvack.org X-Gm-Message-State: AOJu0YwWz0bH9taC94/WHdDJZB7vjRK+dm494wQGOgFsCfgfzwp63dK6 V79Xa+zrortsKm1z1izvE7lF2bMyaJfav/syD6GGZtYjA1VKtdy6Ke94RXtC5tNIU19MMNrD1lk Wgu8JSAPxmCsxKJsgvRHu3w== X-Google-Smtp-Source: AGHT+IH+U5NNduIwURg0BoDlPsKnnOIwfCnZdS3eRXACF/uPNRGoE141bvOCCDVesMcVlUE6OG1mnMpg0Q9mT2r6sg== X-Received: from pfu5.prod.google.com ([2002:a05:6a00:a385:b0:725:f376:f548]) (user=kaleshsingh job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3016:b0:725:c8ea:b320 with SMTP id d2e1a72fcca58-725c8eab756mr18454838b3a.14.1733798512543; Mon, 09 Dec 2024 18:41:52 -0800 (PST) Date: Mon, 9 Dec 2024 18:41:18 -0800 In-Reply-To: <20241210024119.2488608-1-kaleshsingh@google.com> Mime-Version: 1.0 References: <20241210024119.2488608-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241210024119.2488608-17-kaleshsingh@google.com> Subject: [PATCH mm-unstable 16/17] mm: Fallback to generic_mmap_hint() From: Kalesh Singh To: akpm@linux-foundation.org, vbabka@suse.cz, yang@os.amperecomputing.com, riel@surriel.com, david@redhat.com Cc: linux@armlinux.org.uk, tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com, ysato@users.sourceforge.jp, dalias@libc.org, glaubitz@physik.fu-berlin.de, davem@davemloft.net, andreas@gaisler.com, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, chris@zankel.net, jcmvbkbc@gmail.com, bhelgaas@google.com, jason.andryuk@amd.com, leitao@debian.org, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, kernel-team@android.com, android-mm@google.com, Kalesh Singh X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2B062100011 X-Stat-Signature: 7onmnww6emieppq177f8tde3qi11qjpz X-Rspam-User: X-HE-Tag: 1733798489-472503 X-HE-Meta: U2FsdGVkX19IQuus+9snVGwkNxiq16KG5KXUHYpMVE2UEiBXiIv1l6YBVxFBKSM5x07605u1EA/l4Tdh1j08YQX825uEpgOXM0JFKcs5IX6kkrxbsp46NldP7nV77nXrIBCYrmmHCf1Qwcuy5vOQCnVNhbW3dg6MpFSog67wE399q5impSq142S+PVhyj2et/gCLB7TmeY+jVSFMrK38d6TJ769Yg+mawFulrXrT9Y2tEX1HXSwJIIAbpFOZcX8aejjyo90jvqAHlJacSAhBwg1rBfQimK7KH9FXI7w59DohO/zMKUAHxObriaKDK4Iw2fYvbwzvLQv4cJbCQo4B2WyvTgkffkcNpLw2rPw6ryudhtwV8ksy9ccWezg07p6ik8QdXgQ3cjvk6RbIJQ36iR926Z0lXdEB3uGxh0+xxyCKvnwD+c5hyibgOuZt5Uo3ACiRIhxLaWNrPFBSbfGYLmsLIZVY7FUo+zzaLLiVO+xMQrHpNJSyOK6MLLfForbrUt+oiB20iztfOwOZ+iLAkj3kj77uBSokD7J+nwkP8Qu81cP/APADf8tXJO5weOToYF/4dRZ5yvrijf9pXxcvVEejNBUXaFOI7Qhzb76kzJX1iYbvJ5TRLvBq3iixnUbkQmvvdmtCNACZJu5OoFph5W/lAm+GaXBOZEzvrkve1E8XuhJB32Agxm7Y1i00fF8RgGUvfjBu6OUzsZzWKWLd2fhj1svxkN0/tJIwOtz+/zWJSPH2DKdnt5OHZzjy8DeNbB0j4TIE+QktJvCZ1W+5QWNIQ8fnX1pvcM73I51yifbJ+dvQbzi9kuFQw1zHbjLfKFOLhy8YwZoEeMq0pVGp4rR6JIm9f6gFkHgavs/jEMpg+dU/62ujeKmjjrSADaH+5ajx4gyuOLzEL1Pu83CyLvT2JNxc9BSS9QyUG0bNXyBf6weZtSOMpRM9Hk5+utlHl6OLcAjolxm/pZ5vbPT qi6JVJsP PeggK+G237RatnGGLZ7QGS2U0DNVF5CiIYjjixQcCwuCR6whD54Q0FBGQFq2Xly8QMwJnhiIpPgtPEunCO103it9cQ2v1vFlQ9ZuPs/szrIbuY0JThq9aHvLOBfcW0JMeiV7safpXxYzpTTAdKleWrnGFjoiaYhjPBhOKZ3cCYTbtEyohF2V5s9IOAYc5MXK63iAaOukSsup4syt3s48YywuKqVg4Ic5FcjdE+Id1sseMf/vFCWhKDHVTngWkddFTEBiu0hlwJkO19Cw1+Orkb7HHyJuWIBKVXGysTdkb3kKXdWIAfJ/BkGw0HMapXPxTBHq3ISIElF+x3UQT0nzDROMhmE9115Dbna6UzCZhU/KHF0KsCUiQNEm1JkTSNEws+jlTtmQi94bUdclDcfYJgsApzOWDAH5OffQ+Ggx0E94KLSkmVDMwykTVeWE2ItybOi6QFOKqK0noqjUe7iwHZny8yHZJLDToEResKaMivs96kNs8McoWNgM8kbM9dBMv12A98DJZcRuxQ/zPiG18AdD4dn9Jhru4ytL0MdT5dlomrbYudkyoOAJZ2ur1/tUtjH4C9eTcn9wuFXkGfYsyr+l/0qSQpWFV/NzIadYDiXu4jm5udkuie0PhBg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.296719, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: If an architecture doesn't provide arch_mmap_hint() fallback to generic_mmap_hint(). Signed-off-by: Kalesh Singh --- mm/mmap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index e97eb8bf4889..59bf7d127aa1 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -691,6 +691,15 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, } #endif +#ifndef HAVE_ARCH_MMAP_HINT +unsigned long arch_mmap_hint(struct file *filp, unsigned long addr, + unsigned long len, unsigned long pgoff, + unsigned long flags) +{ + return generic_mmap_hint(filp, addr, len, pgoff, flags); +} +#endif + /* * This mmap-allocator allocates new areas top-down from below the * stack's low limit (the base):