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 D8C72C433EF for ; Mon, 6 Jun 2022 14:43:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43D5F6B0071; Mon, 6 Jun 2022 10:43:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EA116B0073; Mon, 6 Jun 2022 10:43:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 265046B0074; Mon, 6 Jun 2022 10:43:16 -0400 (EDT) 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 13A516B0071 for ; Mon, 6 Jun 2022 10:43:16 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DF03C20954 for ; Mon, 6 Jun 2022 14:43:15 +0000 (UTC) X-FDA: 79548078750.07.F401819 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 630D91C0058 for ; Mon, 6 Jun 2022 14:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654526594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hmegJDlciN/B3fxPivIljj+5ACoeX4tuyNcnTvSLxao=; b=Ds9PSrlLiSB/DEvGPcj0hg2YrHsFExkoD+pH5eIizgrALPntJ9OSfk5aKGWXG9KJi0xpmE F1m4C4uKDjdC4I3cQ73Qq//NubpWUXQz2CYJFfnvEZ5lILBsOVGXPH4BzGRpLax+asQ1wi oT+NgQhFBOy50kUywDswnRL9o4giOkw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-_HnDUNqUPp-i31QtVv_EcQ-1; Mon, 06 Jun 2022 10:43:11 -0400 X-MC-Unique: _HnDUNqUPp-i31QtVv_EcQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3224A101A54E; Mon, 6 Jun 2022 14:43:11 +0000 (UTC) Received: from localhost (ovpn-14-4.pek2.redhat.com [10.72.14.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80B2E2166B29; Mon, 6 Jun 2022 14:43:10 +0000 (UTC) Date: Mon, 6 Jun 2022 22:43:06 +0800 From: Baoquan He To: "Fabio M. De Francesco" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior , Matthew Wilcox , Ira Weiny Subject: Re: [PATCH] mm/highmem: Delete memmove_page() Message-ID: References: <20220606141533.555-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220606141533.555-1-fmdefrancesco@gmail.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ds9PSrlL; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf21.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 630D91C0058 X-Stat-Signature: 4apge4r18tg53jxk3jan4y7htt4heyxo X-HE-Tag: 1654526579-954508 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: On 06/06/22 at 04:15pm, Fabio M. De Francesco wrote: > Matthew Wilcox reported that, while he was looking at memmove_page(), he > realized that it can't actually work. > > The reasons are hidden in its implementation, which makes use of > memmove() on logical addresses provided by kmap_local_page(). memmove() > does the wrong thing when it tests "if (dest <= src)". > > Therefore, delete memmove_page(). > > No need to change any other code because we have no call sites of > memmove_page() across the whole kernel. Nice clean up. Reviewed-by: Baoquan He > > Reported-by: Matthew Wilcox > Cc: Ira Weiny > Signed-off-by: Fabio M. De Francesco > --- > include/linux/highmem.h | 13 ------------- > 1 file changed, 13 deletions(-) > > diff --git a/include/linux/highmem.h b/include/linux/highmem.h > index 3af34de54330..fee9835e3793 100644 > --- a/include/linux/highmem.h > +++ b/include/linux/highmem.h > @@ -336,19 +336,6 @@ static inline void memcpy_page(struct page *dst_page, size_t dst_off, > kunmap_local(dst); > } > > -static inline void memmove_page(struct page *dst_page, size_t dst_off, > - struct page *src_page, size_t src_off, > - size_t len) > -{ > - char *dst = kmap_local_page(dst_page); > - char *src = kmap_local_page(src_page); > - > - VM_BUG_ON(dst_off + len > PAGE_SIZE || src_off + len > PAGE_SIZE); > - memmove(dst + dst_off, src + src_off, len); > - kunmap_local(src); > - kunmap_local(dst); > -} > - > static inline void memset_page(struct page *page, size_t offset, int val, > size_t len) > { > -- > 2.36.1 > >