From patchwork Tue Dec 10 02:41:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 13900764 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C60B3E77180 for ; Tue, 10 Dec 2024 02:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=plyHizQjFILOlGH5Iba1IrDdDMxWHhXvOcpLcYrtGxg=; b=2qj+FEh04qWjanWAw01hFkaPJ0 M+snQoxkV6BqFk8Til1KBI1XJZYti6qhD1lkbKekgb02r3N1fEWczwZNjGzEm/EoJmQCsr8LvyIEX 2kX6MIntgwaBcZOpgBzIkRHeFshkF9DVPv1qqkXcl5xYxSzmDIEPoEpHciPzMp09UM+zBgHBzq92Y 2TYvK+c0SwH9HqB9B2VivL5JfJi5j8QdE1/vzUM8rrOIV8xdq6yYFiWyS6ujyF1DOwOOMYX3xpvXs myQ7++O19/6LAZAd9p+93pzxD3ClbzvoGqdhrRLPk4vT7EkfNS8Fw4cKLY6zEACNkKi7Tyce0xneN bXYvw4CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tKqHr-0000000A1gR-1bRk; Tue, 10 Dec 2024 02:47:47 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tKqBq-00000009zak-0klQ for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2024 02:41:35 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2efc3292021so1880775a91.1 for ; Mon, 09 Dec 2024 18:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1733798493; x=1734403293; darn=lists.infradead.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=plyHizQjFILOlGH5Iba1IrDdDMxWHhXvOcpLcYrtGxg=; b=lmHn/p9sp7qR4UEF06UGklTWqS1XXlMMeyxO5WAYs1dH7h8zydt0sozDzjKjMPUmZh hKh1zceg8a3e23Eqp3iDoKcBX+WuVbJDa1L+Zk9Jfrz5OZQLB33iz8rUabKmAyhcxd3X pr706uyeiVYH5lb8+RKMdM696arEC8m7oo1nM7Zlrag2HyPdn78bNOnWe/AfqDOybx0D uedNEy58ptbyBJNGXvvnMEA7UCvSKppCo+RWOGhL4pQT5NJTO6RkVWzoQlJbBYY8gZ2R tC50mPJh1Rjb5wdz7AY31nRksKLyN4US8s0EAfJqUljrO2sJmIN0bHG4t21kPznOgjTb HSmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733798493; x=1734403293; 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=plyHizQjFILOlGH5Iba1IrDdDMxWHhXvOcpLcYrtGxg=; b=A4LIpHM/mwzXiv4VVSLtiIFQzgb6m6zX4dvqpq+t95Gwr0/exKZco09PGUvnhfn7X4 MTCKZUgEMaXDhrHM5BdRTkTIjBPA/nqwP4bjyNI5yHJ2WfUGYzFmH1J0PD3sJSPFvA9/ OPeMYUVadnIGOKE9jZYCQy5+zK2Q3mgYoDnebOwH6T27WmxMBxXvkBfwIFnokFhwRtJ8 0IKaYdG5J25fkijRkoFqeiLYns2fmouikdvuy8WIPhQ4RABwiuSiYSwiKy1EkJ4Ae35D TaOeyzUJuWSeDHXBFumEy2gDTKiDcUxXxlqFSBkZJPSx2LVxhTuQC8OD9MJPPgmdCBMu TDLQ== X-Forwarded-Encrypted: i=1; AJvYcCUNAbWN1RJOwReB+70yhNKHIFsOmIncjkUszl8zY+GvNP/z5Tx0ANief2TKrRgfi5nrtTIcKg89kEfIrgEN8OCj@lists.infradead.org X-Gm-Message-State: AOJu0YxSXF8a08RynwBkvLRYkDEp0oIIY9/UzmLetSxmV9TJfkefZ8YY 5apjMvdKHRs0s8COiZDLiF518hEOOJED+cM5VYT0G3+TMU3HH9GjyTDAmZp+NJ8Sy1Bl6ly90ff UaDttMx7WDJVmhz5BLIGyjQ== X-Google-Smtp-Source: AGHT+IHwTbEIW/FAeU1sg3ure6LNMbce1+qfNwJ7QwjwcLyYjZmtwQZSOt2eORyWNRKplpOxNs0RywA1YRSDvXTeEQ== X-Received: from pjbsd7.prod.google.com ([2002:a17:90b:5147:b0:2ea:5c73:542c]) (user=kaleshsingh job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3c0f:b0:2ee:ad18:b309 with SMTP id 98e67ed59e1d1-2efcf1700c3mr4344722a91.3.1733798492790; Mon, 09 Dec 2024 18:41:32 -0800 (PST) Date: Mon, 9 Dec 2024 18:41:07 -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-6-kaleshsingh@google.com> Subject: [PATCH mm-unstable 05/17] mm: arc: Use 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241209_184134_208202_310145C8 X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use generic_mmap_hint() in arch arch_get_unmapped_area(). Signed-off-by: Kalesh Singh --- arch/arc/mm/mmap.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c index 2185afe8d59f..6b1fcea06779 100644 --- a/arch/arc/mm/mmap.c +++ b/arch/arc/mm/mmap.c @@ -27,7 +27,6 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long flags, vm_flags_t vm_flags) { struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; struct vm_unmapped_area_info info = {}; /* @@ -43,14 +42,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, if (len > TASK_SIZE) return -ENOMEM; - if (addr) { - addr = PAGE_ALIGN(addr); - - vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } + addr = generic_mmap_hint(filp, addr, len, pgoff, flags); + if (addr) + return addr; info.length = len; info.low_limit = mm->mmap_base;