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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45368C369AA for ; Wed, 25 Sep 2024 08:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:Date:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2MYj0BFyxSovkaR7A6xY2XxO0bUPs/NjD1nFL7mhK60=; b=0tZTNVUktrNQydpku4N5x3H52V j1JT/dUoTkj6mLzktxnARZaxxRw2Zo14anI89wrdeRJPqnd3QW7iLjq7SNn6dhLRdNUcBx5x9sKeu HffSrHfdMMcwAb7smTdrzJmsyOzejJGmOZXQDW1Eve+cFgoeTNLUTaWxdnDpq1zSgzTUb35XJ9pTH Nfnjj9GrdpFdF5vc841UgoUpt+7zwE6cZavsqlDbC07cvwtrSZyaMO+2HlOyTDw1tj9pFijBBgmSy RSRCdnHw8gkgfa02xoJA3c40U4rGmrrfWpOiQPZT1i/kki4Ga/hZq92OJqCyt8aT3WpT3JnGxyX6t fuXJLdNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stNOe-00000004V6R-3tkM; Wed, 25 Sep 2024 08:29:16 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stNNT-00000004Uyu-3FZ0 for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2024 08:28:05 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3e03974b6a5so3129767b6e.3 for ; Wed, 25 Sep 2024 01:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727252882; x=1727857682; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=2MYj0BFyxSovkaR7A6xY2XxO0bUPs/NjD1nFL7mhK60=; b=AhhtUkf9BltbumVB4GaAxlmBD9qQiNu+HSO0d0MRjpU13ITIoqWyNgcOre3sYNwMLt 7C02O+NyF4zWF3Pj5/V2+Ya/HvRs2KjqaQ//KT1wiZ+M2EN79IH2Y9mR1gC5JjsVAI90 0VTCasfnPPTlZs1Oxk18+GjuqGNKINIGpbSlQ615bXfNidE48UHUf7SThdp7cA62Y2Xt 4jI2WkAR29b0EkUu3RR33HKSXxuxVL9ndbICnvIpCXFyZZ+2E4oczitblBcaK0aKRCpR hNAOGhZH3ZJ+idqiSFSBYBwZU8zEyv/+e75z3xj2NqYuXrjTy0HDdut5QQuBYzv+lArM tHjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727252882; x=1727857682; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2MYj0BFyxSovkaR7A6xY2XxO0bUPs/NjD1nFL7mhK60=; b=VTRvVb9vks0s2uZnw5jcfDm1RH1hsMtMb86XGB0MgqOj2dHSwFgdx9Mnzw/yurEKsw xtne3XU4YiN1uJBRgTzrk3E+RfeCXMSMD2t/ooUXzJ6z3n4eVkIHRu4w4K/yKSQPC7/3 4uvE3h9my1kxhkp4Ri8seoVzN5Wb0bQ5bnrj0uyWNygZjAP0pcDJfJ3doAPjUSJU9DO7 cjG7xuG3h/+nJI5eavh7bf4u/6inrQkQqYGyFS+3BV3+8P3b7Qtegy+retD3UsokHS78 eyCI1MzyobhNNFL57/eimnNtEc0eHn1rrXRL/MTJFwDC2kFsYMpokwzIsPo6xdLJc87v 7s0Q== X-Forwarded-Encrypted: i=1; AJvYcCUm5CE9lGMw7h6rI1PnLjYW24K504s5Hux9Mq5Kzpr9t0UNXCEKuTK5qubjiENCfW8fwWxkTNK2cETyMP2mb34D@lists.infradead.org X-Gm-Message-State: AOJu0YwQRjNCoematovQTlys2b8KoNR6Hexbr0ZMFOmBNTeQLqlAcZ8v 8efHLlb8afWxuPwve5ZJ38CYRZ2UNA3YaXPsegJre5jO0VlU0o0WmFiojw== X-Google-Smtp-Source: AGHT+IGgJbM6Fn6q5vroZqSbVqRZGRNq0IvIzjVE0zJdpYVwVw64Mu86PhYWJn2LFxh7GpvX2x2iuA== X-Received: by 2002:a05:6808:1b14:b0:3db:3303:834c with SMTP id 5614622812f47-3e29b809350mr1539389b6e.39.1727252882339; Wed, 25 Sep 2024 01:28:02 -0700 (PDT) Received: from localhost ([183.226.245.34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6b7c307a1sm2252223a12.14.2024.09.25.01.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 01:28:01 -0700 (PDT) From: chenqiwu X-Google-Original-From: chenqiwu Date: Wed, 25 Sep 2024 16:27:59 +0800 To: Oleg Nesterov Cc: "qiwu.chen" , corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, paulmck@kernel.org, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v4 1/2] panic: add option to dump task maps info in panic_print Message-ID: <20240925082759.GB2941@rlk> References: <20240924074341.37272-1-qiwu.chen@transsion.com> <20240924113322.GA7248@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240924113322.GA7248@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_012803_837822_E4EF7655 X-CRM114-Status: GOOD ( 19.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 24, 2024 at 01:33:54PM +0200, Oleg Nesterov wrote: > > You didn't move get_vma_name() from fs/proc/task_mmu.c, so it also depends > on CONFIG_PROC_FS. > Sure, thanks for your advice. it should be moved to mm tree without CONFIG_PROC_FS dependence. > > + if (path) { > > + name = d_path(path, name_buf, sizeof(name_buf)); > > + name = IS_ERR(name) ? "?" : name; > I think this is an easier way to get file path name which deals with IS_ERR(name) case. > perhaps this needs mangle_path() ... > > > + } else if (name || name_fmt) { > > + snprintf(name_buf, sizeof(name_buf), name_fmt ?: "%s", name); > > + name = name_buf; > > + } > This refers to the code section of do_procmap_query(). > Why not > > } else if (name_fmt) { > snprintf(name_buf, sizeof(name_buf), name_fmt, name); > name = name_buf; > } > ? > Sure, this is a better way to deal with name_fmt case. > > + if (name) > > + pr_info("%08lx-%08lx %c%c%c%c %08llx %s\n", > > + vma->vm_start, vma->vm_end, > > + flags & VM_READ ? 'r' : '-', > > + flags & VM_WRITE ? 'w' : '-', > > + flags & VM_EXEC ? 'x' : '-', > > + flags & VM_MAYSHARE ? 's' : 'p', > > + pgoff, name); > > I don't really understand why you skip vma if !name... > Well, the vma without name seems no sense for debugging, skipping it can reduce the maps space. But the disadvantage is debuggers cannot get full maps of task, perhaps we shouldn't skip it. Thanks Qiwu