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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68873C433F5 for ; Thu, 26 May 2022 14:48:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCFE78D0003; Thu, 26 May 2022 10:48:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7E418D0002; Thu, 26 May 2022 10:48:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6B2D8D0003; Thu, 26 May 2022 10:48:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 97CAE8D0002 for ; Thu, 26 May 2022 10:48:36 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5FB28552 for ; Thu, 26 May 2022 14:48:36 +0000 (UTC) X-FDA: 79508175432.28.1B432F9 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id 42C5C1A0047 for ; Thu, 26 May 2022 14:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=XajKRvSeO/QVCcSngDhJcemAQOYMqethCrl70Mst4wA=; b=Xq6l+6OoN8La9V/pSFMmO1xN0i oIkeCbllTOrhxq1jUTDMNF+XFiekz3Rak7fhsktAl82peCvDxYczl7SRpcAt0xql2EImJT4rGWfN0 yJ2Ky8lJxfu77nWwqs8rW2UKT9YbfuBND/7lubMOUw5bnM7YhU38iUwqNfMVpq062RIW3ky6g3qKf NZ67Tbqb5qU2meOCy2qx5ux5ysZvnCG3oWcgtIhFwuPa1M9IcG17MaLSZK8lBp8twGspxrloNdEp1 PMqMPuTcFzWvo9ZcUTyiR4RUUtt2slc2IDhSuRCmKnNohlHcGtmoAa0tco6KZvX0H5hj8FTkEFD71 8K59KoWQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuEmq-001JzQ-Jo; Thu, 26 May 2022 14:48:28 +0000 Date: Thu, 26 May 2022 15:48:28 +0100 From: Matthew Wilcox To: Ira Weiny Cc: linux-mm@kvack.org Subject: Should we delete memmove_page? Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Xq6l+6Oo; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 42C5C1A0047 X-Stat-Signature: afwx7xo79zoku9to6sgxb7tgj5kjhph4 X-HE-Tag: 1653576502-951604 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: I was looking at memmove_page() and it occurred to me that it can't actually work, so we should probably delete it as being an attractive nuisance. It doesn't have any users. memmove() isn't magic. It compares the source address, source length, destination address and destination length, and then does either a forwards copy or a backwards copy, depending where the overlap is. But 'dst' and 'src' are guaranteed to be non-overlapping. They come from different calls to kmap_local_page(), so even if src_page and dst_page are the same, src and dst will be different. We could fix it up. Include a compare of 'dst_page' and 'src_page' and if they're the same only kmap_local_page() one of them. But since it has no users, perhaps just delete it?