Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp417903lqh; Fri, 31 May 2024 05:40:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzkVHe1AGfOnOq3AuH5bthRW9Ogf0BpJ2Rp1wttELhDOkvWQmX1uAH6YtX1P8VtOh03R0yFmkq1FAyDZZj3TrOuQLOSWK+WKKnY5Oh0A== X-Google-Smtp-Source: AGHT+IErUArBKsxmtMHVuHiqpXQwu2B2thKMEq8GoNEmuqrzINkPzAzSrGwV8utsNtZwGOe2nkgC X-Received: by 2002:a05:6214:310c:b0:6ae:283a:b5b6 with SMTP id 6a1803df08f44-6aecd56dcb8mr19618806d6.8.1717159218748; Fri, 31 May 2024 05:40:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717159218; cv=pass; d=google.com; s=arc-20160816; b=hO/Ttew/Lk0vB17pgIQ9Pul4906gV1f7ZoLFjpUjYrs9gSu8LTrQaTahbJrQlg3lqj d3uOSqwa36NUXaBJWP15Q+KP2Q3E/eKI0Q5cWmA2i935wvM0sJnPwyEIwwdRbI+odn77 ZpS05w3krf8PNUBXHPLIax+aNBUUqrVcNGffDYnMueVDqS7/gb1mhfFGnLq0tOZFBk36 Vmau9CLxQLCc1OTsm8QUPwP4CSieJuM5qJKrd5DhnP+scJvWeXcqegezaaoMexGgSm32 3ElX1wuWlHvCox7X1ul6UKCSvHjf7HLIWsMsqLhpUettjm9YLEa3qmlUJ3ChSjRgGAeG D3Fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=CrO+EUJ3OxeD3rNJ/hjDUHE3oN2y19xYWckiJsPmQtg=; fh=qbklawWMuZi6yTa9ReBJcldai2hLjKKSAt71P/I16vU=; b=bfeR/rYoHxBqIejkDs579u85CTO0JGJrcLNxMsjH810LQ4BImz+6qdnQb4AX6Mggs3 O+Qcg6qUumBP6ZC2SnkRFjY/EIpBCZdOYpd5OEvQhpRpGIYpwAmYmhhbRo7/7Z7AEOhk JwCgO0aqs5ina3jnIt3QQ83o4DgtovRg3nx8inH81rgjulpkpP0WUf+2l3gJ1a99YCFO 7sWpLW6sZ8z3+HvRxsNX6vMNbaB+zJlUtYrxjq4atujhQ4JUUgSEEjpj0k7hKtuo8/7K akFmY/Q5X8ZGOhp1bczkJ463+jjKjDsGc9bY/a22DnMDMFVtpIlPA91Z7P+KMXuZ3O1v pkPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-196805-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196805-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b401973si14639676d6.242.2024.05.31.05.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196805-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-196805-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196805-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 292DB1C247EB for ; Fri, 31 May 2024 12:40:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C14815921B; Fri, 31 May 2024 12:38:23 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59C32158206 for ; Fri, 31 May 2024 12:38:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717159102; cv=none; b=Awdz5lVxzDJyo/8RGx8YcIiQt/TfF0XpFVnzizxtMVZrZrH6iAKebebeYNNDqKOHSeDwKo2u9T3XiOWZ9tSdJJsVV7IDsXgQy4kBVbsctNjaAExP2RI9KhznpSqt+ejeHuKKs0Fa7MqpzpSrvpymIjP5ZiaP1R6Y2B1CvRz6K5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717159102; c=relaxed/simple; bh=7BKfN6/AoLY4VubHJyLreI/VATH/d4iqbNxSWMuyoOs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rimOHn7+jusL5nhrKvFcki75wXAiNWA1ZHyhV8n1N2s6c9sqNIHXC37qzanFhI+sU8OqCeRkubrW582HLoSIRr7N3nAWWSgU1eHKrNzX4ur+nxvXX8aceeHm8kM+4vj7Y9eq+s/FWIeunmM2XeH5LNs2F3lSuBkSrs6G7MuzRFg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B32661424; Fri, 31 May 2024 05:38:43 -0700 (PDT) Received: from [10.162.41.15] (e116581.arm.com [10.162.41.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E1F043F792; Fri, 31 May 2024 05:38:17 -0700 (PDT) Message-ID: <7be21e02-9ddc-4fea-9301-6f80eed5ad0e@arm.com> Date: Fri, 31 May 2024 18:08:14 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [External] Re: [QUESTION] mm: Redundant const parameter? To: Chengming Zhou Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com References: <7f7c3bbe-e250-420d-a7d5-89508d881f0b@bytedance.com> Content-Language: en-US From: Dev Jain In-Reply-To: <7f7c3bbe-e250-420d-a7d5-89508d881f0b@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Yes; Matthew just did a wider fix: https://lore.kernel.org/all/20240531122904.2790052-1-willy@infradead.org/ On 5/31/24 18:00, Chengming Zhou wrote: > On 2024/5/31 19:31, Dev Jain wrote: >> I guess it would be better if I send this as a patch and wait for comments. > Ah, you're right. I think it should be: > > return folio_test_workingset(slab_folio(slab)); > > Right? Don't notice there isn't any build warning about this "const" discard. > > Thanks. > >> On 5/31/24 16:42, 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. >>> >>> Please comment. >>> >>> >>> Thanks >>> >>> DJ >>> >>> >>> >>>