From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 015F7C433F5 for ; Thu, 24 Feb 2022 15:08:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FF298D0002; Thu, 24 Feb 2022 10:08:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 486BE8D0001; Thu, 24 Feb 2022 10:08:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 327788D0002; Thu, 24 Feb 2022 10:08:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 1F6368D0001 for ; Thu, 24 Feb 2022 10:08:34 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DAD038249980 for ; Thu, 24 Feb 2022 15:08:33 +0000 (UTC) X-FDA: 79178004906.21.B97BE92 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf24.hostedemail.com (Postfix) with ESMTP id 1D17E180012 for ; Thu, 24 Feb 2022 15:08:32 +0000 (UTC) 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 AE0A21F44A; Thu, 24 Feb 2022 15:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1645715311; 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=ZhvPrxKDo3y/k7N1v/aQZypDM44hzAqHa4NLnDVbyn0=; b=qUigAGK7UglM1Ax/0DG1gTM7UhXJC+olGB5Jg6pKHUWADN3ajguSfV3usOJPwsWLt7De8W rYVMcfreJ6E5Ltd2sdUkc8x/v/hkQMPAFNs45Xk8s+UHh+TgTpfJ1mfvKVhHZAggpK5xah nRZfMBkwn/On4f7qssX0e/CVxP7H2Bw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1645715311; 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=ZhvPrxKDo3y/k7N1v/aQZypDM44hzAqHa4NLnDVbyn0=; b=BgpBY+F4QZehnI1+NwH3WEFm5LjqdVPa7G7nWnCc7qX7/fo/cbcwvOQ64jll+/lfvrwTZo EWf6ME0hN4ddEDBA== 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 8388A13AF7; Thu, 24 Feb 2022 15:08:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id h6hFH2+fF2IcVQAAMHmgww (envelope-from ); Thu, 24 Feb 2022 15:08:31 +0000 Message-ID: <10429c77-9492-bf9f-be6f-94e52393213e@suse.cz> Date: Thu, 24 Feb 2022 16:08:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 3/5] mm/slab: Do not call kmalloc_large() for unsupported size Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: linux-mm@kvack.org, Roman Gushchin , Andrew Morton , linux-kernel@vger.kernel.org, Joonsoo Kim , David Rientjes , Christoph Lameter , Pekka Enberg , Matthew Wilcox References: <20220221105336.522086-1-42.hyeyoo@gmail.com> <20220221105336.522086-4-42.hyeyoo@gmail.com> <8915b858-b46d-0acd-bebd-80a0c9882a7e@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1D17E180012 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=qUigAGK7; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=BgpBY+F4; spf=pass (imf24.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Stat-Signature: h3dc6cadx4r4di1u8ig5n8ueqz643gs7 X-HE-Tag: 1645715312-863699 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/24/22 14:31, Hyeonggon Yoo wrote: > On Thu, Feb 24, 2022 at 01:48:47PM +0100, Vlastimil Babka wrote: >> On 2/21/22 11:53, Hyeonggon Yoo wrote: >> > SLAB's kfree() does not support freeing an object that is allocated from >> > kmalloc_large(). Fix this as SLAB do not pass requests larger than >> > KMALLOC_MAX_CACHE_SIZE directly to page allocator. >> >> AFAICS this issue is limited to build-time constant sizes. Might be better >> to make this a build error rather than build-time NULL? > > Right. And sounds better. But what about another direction as Matthew said: > passing large requests to page allocator like SLUB? Sounds like a good idea, that would reduce the number of kmalloc caches with SLAB, and I expect also simplify the common code further. > I think it's better for maintenance. Any obstacles for this direction? > > Thank you! > >> > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> >