Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4760805rwb; Tue, 17 Jan 2023 05:17:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3aOAmxCWyNmHkbCpIQqgAMbHdOJWhOOnSenuSif0WfEJg86RHBzQPBPWoFMdN4RZVt40U X-Received: by 2002:a17:907:cc03:b0:7c4:f8fb:6a27 with SMTP id uo3-20020a170907cc0300b007c4f8fb6a27mr13854208ejc.0.1673961472634; Tue, 17 Jan 2023 05:17:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673961472; cv=none; d=google.com; s=arc-20160816; b=KCQJL9yrfXGMKCCU0bOcpKss+QxvMzbTUn5N9xbstFA98XJh8fnY4L28rPVFK6fbVs yRualNzbQXfCtZH9Nu7blPYGy6Pbcta2uB0wS2Y3WZT9pdFLYNGKeKoH6vXrxiWi4HC/ ik3CJKObyrg4i875wmRt8psN5V5Wqbsk5ymi+vrbUYqzP/thgMyRPFh/WSEeUsFVsOi+ ho7EYJGlfT6AyOkPTna1sUDaRao30BpREfoc4pxc61a2eGWwwmz9eoc1MBdyFOeg1MRa hvyFPWQPJ9r3i06g6XC8XPgrod2UUotdDuRkKb24UoSelgyekzEmVhVKNMBo++B1n2jM ioww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=eBch0VSHbnKV/Owivc/UbreapD9Gr0DL7X9SM2fZmV8=; b=bTrZ+QmYqLxvVfAIZ1paBtGRS+ksfGcJgI+n2yuFxF16x2NliYn5p6mfznOuh6qdLM jhPzvbyOJ2V6mfte9XlzeBtw4tCTw2Qzt/JkyHgh1/gVj5ZC+vZJdULFn/S3SMWRkDf1 2roZW/zhGWLMLsVa0A4iLPLp1pAd3v05ee4kYQPxVEplOxTBQReeQFH16WRQGlUQp4Cm L/PMk7FbPT4PpUlJI+OTWvwlxMKOlsm1JYciQJjCgEnPLL5SFiu99YbgkOrZIGnko6R8 gn+bsG/tVOBULwC6KDaOeALLOKJsRgsTPO1vWlLHD28pnv2wHE41bzXeXbqgbNlTYksH zD5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PA8tgO4Q; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr15-20020a170907720f00b0087021ff7bf4si7534852ejc.240.2023.01.17.05.17.41; Tue, 17 Jan 2023 05:17:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PA8tgO4Q; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236817AbjAQM72 (ORCPT + 48 others); Tue, 17 Jan 2023 07:59:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236756AbjAQM7J (ORCPT ); Tue, 17 Jan 2023 07:59:09 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A31BC3866D for ; Tue, 17 Jan 2023 04:57:39 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C7E91686FC; Tue, 17 Jan 2023 12:57:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1673960257; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eBch0VSHbnKV/Owivc/UbreapD9Gr0DL7X9SM2fZmV8=; b=PA8tgO4QYccksGRomyTaYrbBa0zFWnx89nvqGWGBDCAn1lstn+/HgOtSbXXI8I2b8OiPTO xl3GSKWHrUFrp7DB9FC3LuRYIxn5q45+0r+YrCkM1FqfVshdCqj9f6QnGs8WUXds5s4pYS b7SQlC4GqyX6TumYgZ3MNIMK+6gSa9U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1673960257; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eBch0VSHbnKV/Owivc/UbreapD9Gr0DL7X9SM2fZmV8=; b=J5wLNuMfVyIw05+gCOS0e/gwxRQU+Ta1WrfLpzwx15Vuw2prmORLuGKnepuyOxQ2nLDUhb 5N42//+Pq3jIouDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7E60C1390C; Tue, 17 Jan 2023 12:57:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9qyHHUGbxmOIcwAAMHmgww (envelope-from ); Tue, 17 Jan 2023 12:57:37 +0000 Message-ID: Date: Tue, 17 Jan 2023 13:57:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] mm: Functions used internally should not be put into Content-Language: en-US To: Rong Tao , 42.hyeyoo@gmail.com Cc: akpm@linux-foundation.org, cl@linux.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penberg@kernel.org, rientjes@google.com, roman.gushchin@linux.dev, rongtao@cestc.cn, sdf@google.com, yhs@fb.com References: From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 1/17/23 03:01, Rong Tao wrote: > Hi, dear Hyeonggon. > > If sl*b_def.h is not intended to be used externally. That is to say we should > never include sl*b_def.h in module? The following code will not compile success > since commit 40f3bf0cb04c("mm: Convert struct page to struct slab in functions > used by other subsystems"), but success in older kernel. Especially for modules > that use the kmem_cache structure, this is catastrophic. If such module was part of the Linux tree, breaking it would be noticed sooner and fixed, probably by changing the include to "mm/slab.h" instead of sl*b_def ... > You are right, if sl*b_def.h is not intended to used externally, Modules that > use kmem_cache structures should not be designed from the outset to use > kmem_cache structures. Or the kernel can use this patch, and these modules can > be compiled successfully. For out of tree modules we can't make any guarantees. It's best for those if they don't rely on such specifics. As Hyeonggon pointed out, there are more robust ways to get object layout than including kernel headers. Also it was broken since 5.17, which is quite some time ago. Is the code you're fixing still relevant or was replaced with something based on BTF already? > Best wishes. > > Rong Tao