Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp416736lqh; Fri, 31 May 2024 05:37:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOpO3MA4e4Q7DrcAdbJ5tf4ZXhKfA3PUIurWTdsU7fFG/EjL8hLOwPSWpv4fY5fFjbh1c3KDgy8dCuwdkfmSXxcfCjyix5fo3xwbOHTQ== X-Google-Smtp-Source: AGHT+IE04Uv6m58pe0h7f5yPJ3rsaWAzuJYdSsPgE3TfhL3kZSYcyGUCye1EWxauscSFS+13inTY X-Received: by 2002:a17:906:25cd:b0:a66:c338:65cc with SMTP id a640c23a62f3a-a682041e505mr104163166b.19.1717159079630; Fri, 31 May 2024 05:37:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717159079; cv=pass; d=google.com; s=arc-20160816; b=XVJR1DVXZjCp94XL27A3Yvt9sV60Z/i4RZaD55wBodyceCxVOjjPyTvz0GrMGZW+F+ 2kyBaAT4/GDrgTd9kK+1KU66KgJ7ZTaGW/rDsK+lGNXh91XrA6jcjhrz9Iek1H0ALmup 6T832JRqvwvBmDy2irRyydXh+eqXGYwlrcWxvluvSwxHo9uyWdJp2PTnvJQuVFGBGpCz wbxWYpz2Q0IhfUMM85F58vTbt7/rh0qfX4RzUup2pKkzpc8F6cbtL211kgU1IWNGZN51 j6p1eTSGkbnOrtbEKOdDNZN4z9+ilUQAvyMLnAZCpCCaxR52g1MfPbqkg1h264qmII+a j4oQ== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=pobb+qKmbEVkLRW5gpiFE+2DxXv9n/WgMfYUIElZ6qQ=; fh=/akjcHkcAQkAaLdoSKGSEQdeXawAIqSuwWQ8+mVDE3I=; b=uFU91cTKCw1dG55CDr494nQF0gRvEX/RuWAStrtf+Gb+q+DRnPziv4/We/Lpc9oX6K 3C0n0yXETlJK1Y9UV+GYf0/dc5k+mVfoABjXMQu89ODk7ngas33DivhDHsdwSA2hefLo Krvc7fG2F5GDImiaxCH/axCQXVjoIxwQMxZxtv2YuHyXeWNn/GyAMhn8hIw1bVah/tUz 2y8FCCEi0Jj4D1J0uYOVin80YuRpRPrhUZ5MK91sqWaUODM6unNO5//HnFgSa1FGYaxB rwV2x2Ys/CswSItqkraW32adI6lMyo6/jpv7EQafK/zVFKjp5XC/TwEIUPukgbgscTMV OUVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=E3KaQRf2; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-196777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a67ea38dc41si85238666b.277.2024.05.31.05.37.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:37:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=E3KaQRf2; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-196777-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.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 am.mirrors.kernel.org (Postfix) with ESMTPS id F13F71F27B40 for ; Fri, 31 May 2024 12:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C2D0158870; Fri, 31 May 2024 12:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="E3KaQRf2" Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (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 BDDA3158847 for ; Fri, 31 May 2024 12:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158616; cv=none; b=es79X9vZD14GsDULFtPXpL41idgvYShBrH05wFbjNGMcDDQcWq+5Fvc3yxPz1D5UkQHiSGCqHCY8TU3FdEO81juZWbdJyB+MgI1Kx8RoAE9lvZlBVjuV0bQfJwMcrI7vgJDs/XV9CRyyK3OHHz4T/ORmwk4B8hJ++WQjkNO4mMk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158616; c=relaxed/simple; bh=PVDSnpGmRt8ijqYH04SdOAIHTZQoWdauoklqv/bpCjA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hFezoIOzKDAifdzk+HyYIGZNFF+NtpREqvoX4GW3CGe9rPQHLdHnb29/aXv3W/bOcgyWn39Sb0JtZ76Pg/3reLI7EV4WaBziIbhoqla/1SuAJJSRkYmpoeHjRnfB8vHhp11YeaW4EyaWkZlnANWGA0D+6S+vEIo6+Vbe59sXUc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=E3KaQRf2; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6f8ea563a46so1150692a34.2 for ; Fri, 31 May 2024 05:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1717158613; x=1717763413; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pobb+qKmbEVkLRW5gpiFE+2DxXv9n/WgMfYUIElZ6qQ=; b=E3KaQRf2UlHTHr9r3E4Rws2pyv7MEsbWAVs+K9rj+dMpyqh1RnNeJpTwRwwZ1PiswN VfFF1mHhHWGbYd/a+fjcRY2JTh0lJkD7j3r0B9LoazpsjbIMv0HNMNFpPQikFpVCGtWi 24qaPVV5j2CLd8f+C/Bd2HoFvMSaUU8m+NI/XOVMOhKtPa0xAp7HoZ6ecsfb3t4nTKC4 VLiLSV3QJuXUurs+Fw8lxe83RZ5A1bz7modJIU3NqADPKE5DwmIRkfvapcoxB+FoGPDs chjS0VKJ9XaxMbRoavM90kXWg4xqgO3chgLl65T+sIHHNaPnmyf3mCnzYQgg5tJIsAqa eTGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717158613; x=1717763413; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pobb+qKmbEVkLRW5gpiFE+2DxXv9n/WgMfYUIElZ6qQ=; b=kqYYQS4CpQ01LAEYRWGnE3tk8/dvUblG3jG0KymN0ogkb5JIOfmkKXLle8U33uf7pX 50cs1Dt5o/jrXMVY7C7c4d9SQRAkT2jasENcn1EocsOP9SztmCP2Ixm2D4SSlTSG5bXA fOSAZQ5BwrE4K0loKrqCAYY1z6gaBjNWbP2qJGuCyXzMgMYilq+dk4CQS8oOADJTu0ga V4enfIn07PavvpKkDVzg/2Ut9ybCtapXNHTyq8PDGE99jgPgf0UZjutBf22QJZxITqDk WzOv2ivLYV+17SQvI4ScwhQu8OBSrmyeTxDsIi0Y96dmJ4pSAxQcAbc0J+RBsGyy3ST9 OQwg== X-Forwarded-Encrypted: i=1; AJvYcCXzrJXzDvCuvC3AtU+4NGvqLaHUwwWpNpO5xnq5DGuIgjmyeYExTiHF+E4en2TPRMRrsRwqvkN3smqJFrIx/0cZr126Vm5muP1HY8fl X-Gm-Message-State: AOJu0YxmD4I4Zghf0mw50G8zZ3HVKJtDlvbl4Mf9HDic/LIdSQPinoJt W8+FndoD4qa3RXLixzX3tOXVC0nsO60cS+/81tRJ/IshuuB+0CCbXh1RApltlcI= X-Received: by 2002:a05:6358:33a2:b0:199:28f7:c247 with SMTP id e5c5f4694b2df-19b48c28251mr203744155d.9.1717158613508; Fri, 31 May 2024 05:30:13 -0700 (PDT) Received: from [10.4.66.249] ([139.177.225.230]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6c354b945a8sm1181633a12.23.2024.05.31.05.30.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 May 2024 05:30:13 -0700 (PDT) Message-ID: <7f7c3bbe-e250-420d-a7d5-89508d881f0b@bytedance.com> Date: Fri, 31 May 2024 20:30:08 +0800 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? Content-Language: en-US To: Dev Jain Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com References: From: Chengming Zhou In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 >> >> >> >>