Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp623185rwb; Fri, 4 Aug 2023 20:09:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaOvS4JaCXbMSXHfFoH/ZgWJYd0j4avezrv+7nnXl3LG7I4ibqb/JLXafcwggHY6xN6bvD X-Received: by 2002:a05:6358:24a6:b0:134:5667:a16c with SMTP id m38-20020a05635824a600b001345667a16cmr3760053rwc.32.1691204966067; Fri, 04 Aug 2023 20:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691204966; cv=none; d=google.com; s=arc-20160816; b=RkndCkgthLn6dfHSyhrz54ATg9VUjaraW9ugUDGCS9zHrghZJqRsXSuAaw49OZ/l6q 1JQLvmiFpD5BysRZV+N+g1QP4iqoTtGH3zimvgLHM8npFjb//kFfwaz6kl8qgl5KrU8e GR23DHHmR8W9iAG+s7FxFFv6ViXub0H+rijg7zkDHm3hrY4eMFFU9t5mUiHQ+Rwbxndv /DzPiL36Tl88ErJnK+geJBe8ATeVBLHb2DG5s6E1u37p7gwixQeWydFT3UvtS7EKlXh6 ksiWme96XOzle7Y1siC3XRywYRUP5PSgAYpXtyxwTdsDBicNAkJ2XdhXfyZWE6XHa7wq 3dRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Obl9zYeWA19aTO6N0HXxQW061ByiTF7jKft/3/uVwGY=; fh=mtj7v79RkFrvVPbVIbHcup6URkM6924enWq7Sn3yI/I=; b=vjPoySDKImVjqB/Pm1E55XIjofgsjpXBraf74mu1vlPSxDnq+sLExGlUFrAaoy/oVI YlWX4dROfvpMQJPMDsk3eum85G6+TIcco8OdDjS6/hf0DRVY59aArN2Fxo5snRSvg4Jq Vqw30/O15VVTgZC7SNYyqcaxEulbFsWUJm9YGY7aE3WOSe67YfC8C1EDA9Ei96IYr9Cg NEum/81LAIi6NiTi6D+mQMAuQIEivTi23cXD7O0goGxfA0E6W9CAZkF3nIq5PLgVdcVY h83cYWxNEFP+97dEKPluhTS6P5sWkSsdIL4Uwmo0huzSrY4dIQCaFZpmVJ9bHKT6mXEC PBZw== ARC-Authentication-Results: i=1; mx.google.com; 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 u64-20020a638543000000b005641ddd031esi2568612pgd.752.2023.08.04.20.09.14; Fri, 04 Aug 2023 20:09:26 -0700 (PDT) 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; 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 S229731AbjHECaT (ORCPT + 99 others); Fri, 4 Aug 2023 22:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjHECaR (ORCPT ); Fri, 4 Aug 2023 22:30:17 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B5B4EDC; Fri, 4 Aug 2023 19:30:15 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RHml63lQVz4f3nKM; Sat, 5 Aug 2023 10:30:10 +0800 (CST) Received: from [10.174.178.55] (unknown [10.174.178.55]) by APP4 (Coremail) with SMTP id gCh0CgBH_rEvtM1krxhcPg--.25609S3; Sat, 05 Aug 2023 10:30:10 +0800 (CST) Subject: Re: [PATCH v6 0/5] rcu: Dump memory object info if callback function is invalid To: paulmck@kernel.org Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , John Ogness , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, Zhen Lei References: <20230804091136.1177-1-thunder.leizhen@huaweicloud.com> <7af1d3d8-2d51-40a8-8021-0141e4bf1a0e@paulmck-laptop> From: "Leizhen (ThunderTown)" Message-ID: Date: Sat, 5 Aug 2023 10:30:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <7af1d3d8-2d51-40a8-8021-0141e4bf1a0e@paulmck-laptop> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID: gCh0CgBH_rEvtM1krxhcPg--.25609S3 X-Coremail-Antispam: 1UD129KBjvJXoWxZw1DKF4UWFyfCw15tFyxKrg_yoW5XF17p3 sxWasxKrn8Xry7Cr1fZr1xCry5ta1fKFsxKFnxZwn5u3WUZr9ayr95Ar4xWa4UGFWxKF1j y3WYyF1qkr15ArDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvIb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6r1S6rWUM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x 0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7Mxk0xIA0c2IE e2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a 6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6x kF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE 14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf 9x07UZ18PUUUUU= X-CM-SenderInfo: hwkx0vthuozvpl2kv046kxt4xhlfz01xgou0bp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 2023/8/5 1:31, Paul E. McKenney wrote: > On Fri, Aug 04, 2023 at 05:11:30PM +0800, thunder.leizhen@huaweicloud.com wrote: >> From: Zhen Lei >> >> v5 --> v6: >> 1. Use print_hex_dump() to dump the memory of slab object. >> 2. Add a new dump prefix DUMP_PREFIX_ADDRESS_LOW16 >> 3. Minimize the output width of the offset >> >> v4 --> v5: >> 1. Add Reviewed-by Acked-by for patch 1/3 >> 2. Add patch 3/3: >> mm: Dump the memory of slab object in kmem_dump_obj() >> >> v3 --> v4: >> 1. Remove kmem_valid_obj() and convert kmem_dump_obj() to work the same way >> as vmalloc_dump_obj(). >> 2. In kernel/rcu/rcu.h >> -#include >> +#include >> >> v2 --> v3: >> 1. I made statistics about the source of 'rhp'. kmem_valid_obj() accounts for >> more than 97.5%, and vmalloc accounts for less than 1%. So change call >> mem_dump_obj() to call kmem_dump_obj() can meet debugging requirements and >> avoid the potential deadlock risk of vmalloc_dump_obj(). >> - mem_dump_obj(rhp); >> + if (kmem_valid_obj(rhp)) >> + kmem_dump_obj(rhp); >> >> The discussion about vmap_area_lock deadlock in v2: >> https://lkml.org/lkml/2022/11/11/493 >> >> 2. Provide static inline empty functions for kmem_valid_obj() and kmem_dump_obj() >> when CONFIG_PRINTK=n. >> >> v1 --> v2: >> 1. Remove condition "(unsigned long)rhp->func & 0x3", it have problems on x86. >> 2. Paul E. McKenney helped me update the commit message, thanks. > > I would be happy to take the patch that Matthew and Vlastimil are happy > with, and also the one against RCU. But unless you tell me otherwise, > I will assume that you would prefer me to wait until the entire series > is ready. The best way to tell me otherwise is of course to resend just > those two patches in their own series. ;-) Yes, I also feel this snowball rolling bigger and bigger. Let me resend the two RCU-related patches that we've discussed OK. > > Thanx, Paul > >> Zhen Lei (5): >> hexdump: add a new dump prefix DUMP_PREFIX_ADDRESS_LOW16 >> hexdump: minimize the output width of the offset >> mm: Remove kmem_valid_obj() >> mm: Dump the memory of slab object in kmem_dump_obj() >> rcu: Dump memory object info if callback function is invalid >> >> include/linux/printk.h | 1 + >> include/linux/slab.h | 5 ++-- >> kernel/rcu/rcu.h | 7 +++++ >> kernel/rcu/srcutiny.c | 1 + >> kernel/rcu/srcutree.c | 1 + >> kernel/rcu/tasks.h | 1 + >> kernel/rcu/tiny.c | 1 + >> kernel/rcu/tree.c | 1 + >> lib/hexdump.c | 17 +++++++++-- >> mm/slab_common.c | 68 ++++++++++++++++++++++-------------------- >> mm/util.c | 4 +-- >> 11 files changed, 67 insertions(+), 40 deletions(-) >> >> -- >> 2.34.1 >> > . > -- Regards, Zhen Lei