Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp543736lqh; Fri, 31 May 2024 08:57:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXupBpVxHrZzaz7/2wAlKB762QWHpehTaIpZXogvxIP1B7+bvC8oiAh44J4olcDO61De/L5OYySzGv/ULNIywwxdHlqLij1Q5khf8ZFQ== X-Google-Smtp-Source: AGHT+IElqoF1bT0XcHhB73y2cIQc5SlxBfwigCEa76LrON89OsNX1+KWLGJw7Yc/aJRjPPcg2Wzd X-Received: by 2002:a17:90a:f982:b0:2bd:9319:3da1 with SMTP id 98e67ed59e1d1-2c1dc58aec0mr2548180a91.25.1717171057790; Fri, 31 May 2024 08:57:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717171057; cv=pass; d=google.com; s=arc-20160816; b=qkAVMh/BHWQrm3rFsxIY5YiNGKZt3atpDfiJIXI1V5UAOmRff6xpDNlDLmpAn8X4Dt UhGdYsLoid7+oIlBXMb+wrQqxvzYlMZWaPb0sk5RmPGNI9xjgTQ3T/rQs7B9GluIWiIJ ZjkGvgF7rDn5mxeUDqvfqJCBv7KZ/ViXzXV/lfJdFPg5MayuH8BmgXaFCaUyq3RShR8B KvRqtuec73SswFe6obWabnJK/Fqc7NqWdtMAM7abz9O244lkU3pbi3tkU+T8X06R0Rj5 sMFFibEdJw2TEb7xBAqtCu+q0FYbrGBIMWOrlyOGTlJQl5J5eqMtSLR+VOi1UZWMg3gx 2q1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jyAihqKd6Hda45CnlrSOdjqk2oTnBzNCXKHWOSSfS08=; fh=t+IZHfcbramA5i+2DZrBpmjGQ/ZSnjVfXyxnq2Gy+2U=; b=D0lkxNC5WXz4V8Y1mnE07Yhp3qyboOFgrcxfdhUeyRUZxsov43m+wdrltDoQpntzIf ZefjxK9boLRL7ZG3La4kElY/X8Ua95P+Xh2uBf344lXQVJbGCsKF/IMReF0JxXL9+dwT qAMzUwE7w9aQqtT7zOGgtDFY4484Zbx7zOki/5DFceOhaqvx0qBQJM65isdjnHKpjWeD nB22saSZKP//0yZ6FZlI4H6n5bMGTDdSYuudfbZgoUzgWT/JZs8XYk4gc1WyHRIssyG+ cRll1/CtQ4lr69qqzetDYqDk7/nyVm3t1SmgSgQ4AthLNK+eB0V6RERyJqidjFQC9uTg x5cA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HDY9ElEZ; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196758-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1baa574a7si1420002a91.129.2024.05.31.08.57.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 08:57:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HDY9ElEZ; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196758-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7112CB22A19 for ; Fri, 31 May 2024 12:17:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CADF51581F5; Fri, 31 May 2024 12:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HDY9ElEZ" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39116138490 for ; Fri, 31 May 2024 12:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717157836; cv=none; b=ZF1DPzdhSVcPwUeX5dYUd+QO3Gcb05G9DnBU5m59KY3WzjXQZQS3c6zwwlMaS9vcd1k5uDUKm9eNHdtf78HmzZxDTFKTcODdCsIEKj+FASESiTYCInfxq9anzg0O5G094uAIxvvDIWzKLQjpDsZuYLegMuohKyCNO4EbNfXRXiQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717157836; c=relaxed/simple; bh=C/2Lyf7Lg4rbLPYaZKO6th7rS/4OXvr6QR1MXCxp5OM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=et17lg7wXkAKLDe2872G09LhdJ6kRy423+GBsh43GIDQehvdpH/vfoe3NMcaWdI2XuSaTPY2sADjbxdUwJRRaqeRGEK3RichG4tUj9sGsCpEEffGZNLFKTubWZPF0vCxfpdQ5Pe6QGLNzwTJTZQu2pYEoYqJXyYItafdE8MXjdo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=HDY9ElEZ; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=jyAihqKd6Hda45CnlrSOdjqk2oTnBzNCXKHWOSSfS08=; b=HDY9ElEZC9QCWO1z7fesMTuep6 qymvqqVoiC7kRrNdDlxkZWmkqgX+HmhEo4cqg8q0iosnF0EphRjsAhCWCKIMr6UhVjZ55ZRb0oH2L 6vYfFqpxLPaIjAvh4O2DJTXN2M3VTOL15AU0pmMdLJ8s/MDVTN5vppX0fCKSqHvtFHaKJpsP1NAls 71oIl2eab6ruBXI2bZK0Mtx1xHl0tinVPzn7gaH2Zg/p03dVaWsPmlvFSunecZathoOldAcdGVfIg U0YU6d8J8KTEDQ/TCLqAlss2q7SRCsV/MISxgaCH96Znf0VN/1K7/3i5/zoWnzxqOWEg8CzVmb3s8 pi/U+okg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD1Bv-0000000BhRZ-0Vr8; Fri, 31 May 2024 12:17:03 +0000 Date: Fri, 31 May 2024 13:17:03 +0100 From: Matthew Wilcox To: Dev Jain Cc: zhouchengming@bytedance.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com Subject: Re: [QUESTION] mm: Redundant const parameter? Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 31, 2024 at 04:42:59PM +0530, Dev Jain wrote: > Hi Chengming, > > In mm/slub.c, you had defined slab_test_node_partial() to take a const > parameter. > > Is there any point of taking in a const, when you are anyways typecasting it > to > > a (struct folio *) from (const struct folio *) ? In fact, at the place where > you call > > slab_test_node_partial(), the struct slab *slab is not const. I have a patch to fix this; hang on a second ...