Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4312248pxb; Tue, 2 Nov 2021 07:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc7y/dHGiKMiE8TTFQHpC+mvD93nIFmydZpUw/Fg3ScXrrYliDO8N/+hPHAPv/Sg5uI4jU X-Received: by 2002:a5e:941a:: with SMTP id q26mr1205280ioj.208.1635864144557; Tue, 02 Nov 2021 07:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635864144; cv=none; d=google.com; s=arc-20160816; b=mEqmihi1mjUkfaXtis+LBC822bDp7kvk/oUTWu8ZCTe9bEC3k7Lx2pBXkzQgtbvY1+ jInugIXw+a35MO9IWMNYgCauf+EDjW9fxPAm7i/FGO+qGukVir4Hn01iWLL1YuR1+No8 YUfGdcW+ReFInW/h6jlQOPxRypBrtUtXdHTUOSEN1a7iTwp77/9moKIQxT+2+v6PFHzc f9RvnH2MMOo+vf1Aby97zIUnU17fqpUKwTuBFr4PL8cQyW0qblfDuFZJdCAM6HckrewG tiXns8zdw2l7g5RNJ3ZY2vJhBZBHzTWiw3qvxonRAWbj5jQ+KNCP3Szx086LXjjA74QM wEAw== 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=KLM6q3OCHX8Q1M0ci4/mv4477ca1A686qTV4J0tZwX0=; b=OH27DJGltkNSD+/bhqR+30ZFZ0xBU1xiIkZTogbftFmF6rpNl1/8KksW8BRrgj/j1V V2xKoRulP2uqaMdSDJAdpu4nxbQjvx7i42xgpd5Ahf+40gYEM2pESFfvTHzIi7TCch/U 1cHOj6EVCIcrGlxsyzihSyGxnNFAWEgUCco6bNMEvpuTDwMjt6mCFeXD4KSYmEfBus5c 030vboqIb+VYgiglcfkisAbg8F4WnmUFlHdN6AaphWr+26s/rv8dQgB5iKlJ07bW3Tzt KXjPF0MnYSfjV72UDHiTke3vgzCoS1SL9T3MyL2f6FQYc0KrfhfKKrVfc4jx4e73Lm/q pDtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QVkJPpq3; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=AZYVwT5S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si19934518ilu.143.2021.11.02.07.42.11; Tue, 02 Nov 2021 07:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=QVkJPpq3; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=AZYVwT5S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230370AbhKBOl4 (ORCPT + 99 others); Tue, 2 Nov 2021 10:41:56 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:47706 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbhKBOlx (ORCPT ); Tue, 2 Nov 2021 10:41:53 -0400 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 5FFF91FD4E; Tue, 2 Nov 2021 14:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1635863957; 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=KLM6q3OCHX8Q1M0ci4/mv4477ca1A686qTV4J0tZwX0=; b=QVkJPpq3itzE0WoXuN7WlVkg0kudICKXnbxS6zSLcR4KPZn2Eax2Y1zOQ6Z/R5NmnZOS6J oSgTf2nYDTUYqCbwc3mAAjdMCyN+KDZgFzBSbfn065G9gcdHOwqLeRv1mIQDHYoOCHAXsb MRTe2TAPrx17esQaF0seqeKywB0fZ1A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1635863957; 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=KLM6q3OCHX8Q1M0ci4/mv4477ca1A686qTV4J0tZwX0=; b=AZYVwT5SonZmrPQVLIdC/Tr9c7v8E1KI4OAl/AeFFKn6NO9I5cXP69n/0ussFeCZz4c8Du wn+BwtwPhS6ALEDg== 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 2DEC413BF7; Tue, 2 Nov 2021 14:39:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OSuzCZVNgWG8MgAAMHmgww (envelope-from ); Tue, 02 Nov 2021 14:39:17 +0000 Message-ID: <5f3b17ae-bff5-fd0f-cd1e-fa481f100149@suse.cz> Date: Tue, 2 Nov 2021 15:39:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v2] mm, slub: emit the "free" trace report before freeing memory in kmem_cache_free() Content-Language: en-US To: Tang Yizhou , Yunfeng Ye , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: jhubbard@nvidia.com, songmuchun@bytedance.com, willy@infradead.org, wuxu.wu@huawei.com, Hewenliang References: From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/2/21 14:53, Tang Yizhou wrote: > On 2021/11/2 19:43, Yunfeng Ye wrote: >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -3526,8 +3526,8 @@ void kmem_cache_free(struct kmem_cache *s, void *x) >> s = cache_from_obj(s, x); >> if (!s) >> return; >> - slab_free(s, virt_to_head_page(x), x, NULL, 1, _RET_IP_); >> trace_kmem_cache_free(_RET_IP_, x, s->name); >> + slab_free(s, virt_to_head_page(x), x, NULL, 1, _RET_IP_); >> } > > It seems that kmem_cache_free() in mm/slab.c has the same problem. > We can fix it. Thanks. Doh, true. Should go best before the local_irq_save() there. And also kmem_cache_free() in mm/slob.c. Interestingly kfree() is already OK in all 3 implementations. >> EXPORT_SYMBOL(kmem_cache_free); >> >