Received: by 2002:a89:2d5:0:b0:1ef:f8eb:5d24 with SMTP id d21csp191059lqs; Sun, 17 Mar 2024 17:38:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+m5NJPfaLX+1M0GlD/zJwxehodo8Z/g/8BNnlTaUS08gcZxzGvzxegg5ImA13OAYhqiUCdUxiE6U9gQcJfRfaXaBFb7TDn6SciCMkIw== X-Google-Smtp-Source: AGHT+IHZT7R9qx+5AQfrhXaogCAbDL0xxloUT4IzH+jF4sLyqWl0OoOYlarZeDH26TT+kzHm8obi X-Received: by 2002:a67:eb98:0:b0:476:8cda:8e6a with SMTP id e24-20020a67eb98000000b004768cda8e6amr527901vso.22.1710722287127; Sun, 17 Mar 2024 17:38:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710722287; cv=pass; d=google.com; s=arc-20160816; b=nvzxAeKsVHPJh8nn3YTVPcf9Eekn0E7laeuF4f4e4+Mu/W94gaQnzokeeEXEp021Ev l5ksNnwfy6Xqc6eHMusoRKXUmwRPPqDYCP/yRy/U+TaSaxEeqUbROLziR45afU0RgE5V hp3+6R7DQlXVvuM+o7ABOrOB6MGnMgqv8T+O8+cFanrNvO03VKLdbhAhQ98VMawxPYO3 a3O7ZmG+U+xi5l5870bZU15wNfJChyCIrzvdM/URmGJCHlETPWzBvhc3JBk171isRR/q gfLolTkqEx4o/5RHOQJq5SElZC9d23gYp7DrbpLCttCwlZmGWJIqhC9P5rd3hXliY+5Q pS8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=llGLw6AKMSrRr3ZFJczh7zHhHhI2K4vflzOhWhhSUHw=; fh=BZHyHIOkhYHZunrhUJuK5OOH8DJumK5IwxaQFC1aTJ4=; b=ZPfWd+xJPtTdvgNoA+BRki00r+bbdQiP4c+9vjgG5jUur1gYXTvLNLq1s3gCVd+IWK h6LRgLvNHjfgooyLrU3M/C/Sfb8XYBd9LcQlxeJDmlDL+lBKkECZUgZ1IQZeVggQ/RNX Pn+uy8HuXSwTeQMZrytLFTh27x9Hs7rvRBs/1UdxU850HeHFLBpcZNRZ2CqsV3bynoIF ME39OsFRbTa4ZM45cxN04aqL2+zhPNYZeqVKs7u2xdNUH/U2xzdlXIt8jkiE5Hafl+6+ NZrL3NxHQChPt8K6o4DFrZFo9WW/FwueSze4ihPyThHr8g11ZWlKAZ7/c8cyEijuWZgZ X4rg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E61P8NvW; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-105605-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105605-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z4-20020a05620a08c400b00789d013b342si8194438qkz.580.2024.03.17.17.38.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 17:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105605-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E61P8NvW; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-105605-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105605-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C21AC1C213CB for ; Mon, 18 Mar 2024 00:38:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C179F4FB; Mon, 18 Mar 2024 00:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E61P8NvW" Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C74E72F50 for ; Mon, 18 Mar 2024 00:37:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710722280; cv=none; b=FwCPWkQfk6z2FV/N9c8mQ5VhEnKcleCzVfF4WpBSQPXeb8lCH1vPD+LRhlGr2kmlX5sIBnGSBdUgl8Hrvj+rHMdaircYK2S3TaCn3w5FvNhx/S4gZAD96NUJyZgzkubKecocvAVzcFChLhI9778nxpsDGURNcHeBccTLAVPQlrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710722280; c=relaxed/simple; bh=qBPM3oPalt/c0JhwItpOBOLzEHmAmBaqv6/kGQMl6e8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SDNhS5yFIdyfHbtTqGlNWtMe/Rpn6U7/y7I1M71N/0wP55VRgn80aLQPVO/2WWSgG76hgWBJYu5DaTSRPVfv3T9ZGh5ppnVW9bkDRBnjNrHLA2fAvqrUfqOa8okTp2tfcF+gmbT6YoTHAoKg9fy42sefH2M3+aFMQGe4mVWuO1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E61P8NvW; arc=none smtp.client-ip=209.85.222.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-7e057fb0b69so40170241.0 for ; Sun, 17 Mar 2024 17:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710722278; x=1711327078; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=llGLw6AKMSrRr3ZFJczh7zHhHhI2K4vflzOhWhhSUHw=; b=E61P8NvW9D2nCZmI8sso2b1Z/ZDxotzrftdwxCusT8pFm9BoGYcwNjYmfs8obqFNMj 03YNC66NqhTSAtCvKljTQsstdRRMYcUCk9beRSr0+lfUSLGlTb0FdCQIryWW8gWDvfxD yJR4hxOxSiLrUhKqPr9iYSeBE3WK3iFazKx+YrdyYBqfxkbY0T1LdYoVNlp6TyFP2Uuj cLjLxyYBxokDNfPtS/sEF3GaWZ4Z2lp5XbjzIhmQuqOZ1dwmf4GlLu0MzzFdjERKOGhZ 9pd3/aoo78LIgqiFR2WbkocpMGj1ZwcYPW32PqR/fP8Ve68XjpK+W1o50k84Z4KnvWPp 5KrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710722278; x=1711327078; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=llGLw6AKMSrRr3ZFJczh7zHhHhI2K4vflzOhWhhSUHw=; b=BoJ6l1qOaW7O6gNCVv1ZBv8PNyQ2L7T4OK63z/AhEvi+NEazVPUnTVyaImx9Bc9007 tmEH6ui8M2ciRKjrtU4eGz93YR7ED2nvlx1bGDWVuMR/V4nr+EBg/2Bx6F9v/gnacYIJ YhrtF/l3++7OMHL9BRWuLs92XeXzu5GFBrwRULfyDEHkAEjh+H1D1FkZpXog3Cj+3hPJ 3le3Gv0oVxH5pQjpM4ZAqb8JL/NA4FbJQ0oUm/SqHonwJ4HeUAsci3zFPJ7qzU8rx90s LFRote0syVfYELeDug37qS8G6YV9POQmqOjO+cFr5yR8GhQo69mBY0xMOpBDFg+6YQIe s3jg== X-Forwarded-Encrypted: i=1; AJvYcCU7kl/2y+4N+CdjVi5u7/gQ5pP/lVdt1WLO53Tj8DBSuPCjlLaPyCp6cDyzGJzFRYDyMX0684C4AoF7v16UNrTOX0mzZNdlmL0SoS6K X-Gm-Message-State: AOJu0YxM8Y3i1GbQtQfYrIqVwCy/zalCaiaOpiFAaTIVrMR8d5lDH9v+ 5eWSa+GaR/ZrEq84n/IukDifPdAgVXjSWlRCEvzCJj4fdpzpaiuxeXcVMjL2enihs+RghH2Xof0 YJOQHNI/nKVWmKu+rnbrvbDoUhSw= X-Received: by 2002:a05:6102:190b:b0:472:990d:84a with SMTP id jk11-20020a056102190b00b00472990d084amr7129007vsb.20.1710722277713; Sun, 17 Mar 2024 17:37:57 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240313045036.51065-1-21cnbao@gmail.com> <369716bf-0216-4114-b502-a2d2c819ee8c@roeck-us.net> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Mon, 18 Mar 2024 08:37:44 +0800 Message-ID: Subject: Re: [PATCH] xtensa: remove redundant flush_dcache_page and ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE macros To: Guenter Roeck Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, chris@zankel.net, jcmvbkbc@gmail.com, willy@infradead.org, alexghiti@rivosinc.com, rppt@kernel.org, dennis@kernel.org, Barry Song , Huacai Chen , Herbert Xu , kernel test robot Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 18, 2024 at 8:34=E2=80=AFAM Guenter Roeck = wrote: > > On 3/17/24 17:27, Barry Song wrote: > > On Mon, Mar 18, 2024 at 8:16=E2=80=AFAM Guenter Roeck wrote: > >> > >> On Wed, Mar 13, 2024 at 05:50:36PM +1300, Barry Song wrote: > >>> From: Barry Song > >>> > >>> xtensa's flush_dcache_page() can be a no-op sometimes. There is a > >>> generic implementation for this case in include/asm-generic/ > >>> cacheflush.h. > >>> #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE > >>> static inline void flush_dcache_page(struct page *page) > >>> { > >>> } > >>> > >>> #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 > >>> #endif > >>> > >>> So remove the superfluous flush_dcache_page() definition, which also > >>> helps silence potential build warnings complaining the page variable > >>> passed to flush_dcache_page() is not used. > >>> > >>> In file included from crypto/scompress.c:12: > >>> include/crypto/scatterwalk.h: In function 'scatterwalk_pagedone': > >>> include/crypto/scatterwalk.h:76:30: warning: variable 'page' set = but not used [-Wunused-but-set-variable] > >>> 76 | struct page *page; > >>> | ^~~~ > >>> crypto/scompress.c: In function 'scomp_acomp_comp_decomp': > >>>>> crypto/scompress.c:174:38: warning: unused variable 'dst_page' [-Wu= nused-variable] > >>> 174 | struct page *dst_page =3D sg_page= (req->dst); > >>> | > >>> > >>> The issue was originally reported on LoongArch by kernel test > >>> robot. And Huacai fixed it on LoongArch, but I found xtensa > >>> obviously has the same issue. > >>> > >> > >> Maybe I am doing something wrong, but this patch doesn't build > >> for me. > >> > >> CC arch/xtensa/kernel/asm-offsets.s > >> In file included from ./include/linux/highmem.h:8, > >> from ./include/linux/bvec.h:10, > >> from ./include/linux/blk_types.h:10, > >> from ./include/linux/writeback.h:13, > >> from ./include/linux/memcontrol.h:23, > >> from ./include/linux/swap.h:9, > >> from ./include/linux/suspend.h:5, > >> from arch/xtensa/kernel/asm-offsets.c:24: > >> ./include/linux/cacheflush.h:9:5: error: "ARCH_IMPLEMENTS_FLUSH_DCACHE= _PAGE" is not defined, evaluates to 0 [-Werror=3Dundef] > >> 9 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE > > > > is it because xtensa doesn't include this at the end of > > arch/xtensa/include/asm/cacheflush.h > > while other architectures do? > > > > #include > > > > Looks like it (see my other e-mail). i will send v2 and it seems a lot of other code can also be removed in arch/xtensa/include/asm/cacheflush.h, for example #define flush_cache_all() do { } while (0) #define flush_cache_mm(mm) do { } while (0) #define flush_cache_dup_mm(mm) do { } while (0) #define flush_cache_vmap(start,end) do { } while (0) #define flush_cache_vmap_early(start,end) do { } while (0) #define flush_cache_vunmap(start,end) do { } while (0) #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 #define flush_dcache_page(page) do { } while (0) #define flush_cache_page(vma, addr, pfn) do { } while (0) #define flush_cache_range(vma, start, end) do { } while (0) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) > > Guenter >