Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp524700iof; Mon, 6 Jun 2022 07:55:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYKE60MFhpjVtFkrsTPFBY8PLKGpJd+qPdTuCUDT2IzZsYbBBMHZz87rhxGMqRBudTWps5 X-Received: by 2002:a63:1f50:0:b0:3fd:cbe1:ffcf with SMTP id q16-20020a631f50000000b003fdcbe1ffcfmr4193988pgm.235.1654527354657; Mon, 06 Jun 2022 07:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654527354; cv=none; d=google.com; s=arc-20160816; b=wxUm1Qn1SpmaoE8yVwpTtSY+rEzTvv+O8AYU5A9VIqQn3odVNDeAWqlosCsionq+f5 RFli1PQtmgfdDXOsnYZ0jhFb0zCztoHh4ckYVvK7JkgRS9nsA93fnRm/HBjvof6MqYke hGXn+QMVNzT1CoeryA666M2O6lEvbZOX+adfHziyFfUadTN/t2Gz97OrbTTRxlIS/iDt oOl9oPc/DGw3Q/BZvNdnLVlkmG6wVnDa9TlIy6bdCNSDxwTMh2EGYGitLGzVPQAmAAnz rKIKTa16DDNfOGrRMjYvc/tiJ6WCFBVhdt2Mu/85s/c8MXGLN80dffpXztMKo6m0mULv nfKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hmegJDlciN/B3fxPivIljj+5ACoeX4tuyNcnTvSLxao=; b=LaTOi3pVPgn/xO3f6+zKKCTKf159OlNsAojgB8t/uq+VNawh5ycXmbc/+0KvfW1X49 EjMci3Abr9Nr+1ss/roHxj9dkpKWmyLpuJe5LJ0eebsP0DRmk2lASqbqAos5RGxVW/KP vZK5IGGrfBAp7J31NOI5TgLcFfsvpjZWAkWlP4ylwsX4da9hqs92DstYM8g1NZ5UYKlN Jp1CYRCWNvPjkVY8aLWUX5QE5zmGad0SBsnOHArlpTj8mujjDJZzLSo7q3yWrGlCawJR MZ44igvaAjPOrMZ/atvbJgBbW+gHCVHb72OW8rrPVcDu5XQWS3CPEgcGcLZWDuuKTwHQ itrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aiz82xJC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c9-20020a17090a020900b001e08647560asi23536075pjc.145.2022.06.06.07.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 07:55:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aiz82xJC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70010488A1; Mon, 6 Jun 2022 07:43:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239836AbiFFOnV (ORCPT + 99 others); Mon, 6 Jun 2022 10:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239830AbiFFOnS (ORCPT ); Mon, 6 Jun 2022 10:43:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0849444A38 for ; Mon, 6 Jun 2022 07:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654526595; 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=aiz82xJCLJp+A8LWUnI4j4K586OWNSIytIhsB16pwMbxPw+ckRxU4m4ep5iFklm24x2f6k 0F8rd/aI4dx9kt1g6FqeMAYj50WoetyoGKJwQ3WJEyHCUv94coryvca57lbcTfB+/eXDHQ nuXDOVxUQzm8Qx4wmICqh7mN9CEWHxk= 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-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >