From mboxrd@z Thu Jan 1 00:00:00 1970 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 4FC5CC433F5 for ; Thu, 20 Jan 2022 04:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I2VmAuAvdeG7gdnmp2dk2vAyARGQziQ/Yf6I79LJ6W4=; b=R0G1n/TZFpCutY C3TrsPYhYmw/Y+vpzAPRrTbNFwVEZMRe+Ko0exaAqY0cC2tbw4kHXQMOeqLyTBHcpRfIn91fSClYr qpF8jtQZbY94Pp0TPHj/QN5TXxiul2f9X/k3wck2xKD4yA87yq5ou6O7KmYZYScF/Oblpw/88qoi6 ytJt3UgoGKcECgjB6vG0bcHwPQvSRegRGhc/eAOA0vUTVctW9wZV60NpFVyKBFmSookF/tApk6ieY EIO3GeNetH3ro/pjwTBm35KhMxMaVWrpi9uWOV2Q8ZDxoe0Y6A95YPoAu4ebJa7abnyDhAImqhr4e K5vwEErcctq4U9LbzOQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAP2z-008edN-9H; Thu, 20 Jan 2022 04:27:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAP2y-008ecz-0k for linux-arm-kernel@bombadil.infradead.org; Thu, 20 Jan 2022 04:27:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HHu2vcmAMjyZdp5l/HlaIQrYa0nqInGDI16V4wpDZxE=; b=kM8gwlss+dLkoAyh97n4QxGefg W3ayn98v6j7vqXuUf2HdhOVDe/4Pw1IEe9C6K7cj/vR4tvnJz4g2iWeHPGS5n4uSG4V07nzyZmDmD vlmxnrh51bIlgl62OXy81cYaqtCxb5w19Pa9y2T9y6FtI359xkpwv/yoT5fSHQRLWxAPdafyAjlOR vspfKJn7E3AyAcarQddnd5vKNG50ghktFogDYSAGeCdHJ4HqTYApThMkVc1XtHe2TUkQPFsLatAQy UxqxJ7woCITKqX3ZDz7gde9pPKSX8P6x+2tK9dZzRHaQvq+Wv2FdtHq2jxXBhLl8lXazb4ZY6De8X 8lpHIEIQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAP2t-00DKZK-Vb; Thu, 20 Jan 2022 04:27:36 +0000 Date: Thu, 20 Jan 2022 04:27:35 +0000 From: Matthew Wilcox To: Anshuman Khandual Cc: Yury Norov , Catalin Marinas , Will Deacon , Andrew Morton , Nicholas Piggin , Ding Tianhong , Alexey Klimov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Uladzislau Rezki Subject: Re: [PATCH] vmap(): don't allow invalid pages Message-ID: References: <20220118235244.540103-1-yury.norov@gmail.com> <5b62ed03-8da8-a94d-cc48-a8cac1eae1c9@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5b62ed03-8da8-a94d-cc48-a8cac1eae1c9@arm.com> 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 20, 2022 at 09:07:11AM +0530, Anshuman Khandual wrote: > > > On 1/19/22 10:52 PM, Yury Norov wrote: > >> Why should not this just scan over the entire user provided struct page > >> array and make sure that all pages there in are valid via above method, > >> but in vmap() itself before calling vmap_pages_range(). Because seems > >> like a single invalid page detected in vmap_pages_pte_range() will > >> anyways abort the entire vmap(). This will also enable us to drop the > >> existing NULL check above. > > > > I can do this, but why is it any better than the current approach? > > Because it will just return on the first instance where the valid page > check fails, saving us some CPU cycles and an incomplete mapping ? The valid page check is never intended to fail! If you're worried about the efficiency of doing this, you have seriously confused your priorities. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel