Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7713389ioo; Fri, 3 Jun 2022 11:51:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTz/2PjBrGU6Omupf+0XhDda3aiuA0d9F2n31+6vEldsi+EsQBb0YmOIXaPEaDpoF7cYCx X-Received: by 2002:a65:6a16:0:b0:39d:4f3:67e6 with SMTP id m22-20020a656a16000000b0039d04f367e6mr10187546pgu.84.1654282260021; Fri, 03 Jun 2022 11:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654282260; cv=none; d=google.com; s=arc-20160816; b=qoOs3wdBCjFHx7W5dSHAUP5SqQQ01EefhECz9DGdtiNguTyU7HW0+wC5f9d+N38u6p pmUUJ+xchO5sZ6EFl1AMoBfd8rUcLUVGuP6JwADJRIHFu1j20sllzRs05mDThpaMob6/ WqEDnIf7hNy4NQawf5jDP5KA38keijhi6Y5L9lGojO/pTvrxKTApW/53EZAQLNW+khs8 4wo+ePdZpLPKB0cznqPmvkPeMgEiu0eNUtkpuYcdtlbLFn0ixK9x9XRmdqXIjAqcMOCi a233a5IhbqTD8PbhnHd7oKq9Rr4LtVzimKRRsE8eGSwOqDc6Fd2kph3IjmiRVnGV0zCu WFLQ== 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; bh=+du9GzzlWKEsruJA9NU+7ALtUd7QizBWgQcaYZZVG08=; b=pTTSm4Tmf9SrU9+UzfFTotMR4MUNF5MpBqFWb4lG7ZkJvbkm5M/FXZ7q3WK3GVei4l 3ib0jmNRUU+md2irQDZoU2dvtDfY2UKoI5HF/MacWHLbOT3IrnUtXzrSOAlbx1YtcK2G JlUwdJ904RCy0dSOV7DSLUODGp+g68p2+28qHOWEynjjs++DU4vMth008mAZlndGqJAc QX2OAFs28jvqb+ABDdr+3jhvjlWrWgCPpwyaq7t6DLLlJD33xhdc9y2MBNS/tmUc7At3 X7wQTvKOVW/ashuqtB3ukQA5VRYqQQHb8WqhjzbjKUYkEOh1cDw8htqGFcm9ohhuvdGb idMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=js+kgwVj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a63e34c000000b003ab15789bd8si10274617pgj.198.2022.06.03.11.50.42; Fri, 03 Jun 2022 11:51:00 -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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=js+kgwVj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239130AbiFBUdM (ORCPT + 99 others); Thu, 2 Jun 2022 16:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239089AbiFBUdJ (ORCPT ); Thu, 2 Jun 2022 16:33:09 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 529606347; Thu, 2 Jun 2022 13:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654201973; x=1685737973; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=+du9GzzlWKEsruJA9NU+7ALtUd7QizBWgQcaYZZVG08=; b=js+kgwVj3icCHPEYChJ+I7PlwtEFTudqs24ENkjByXhkaAOgJZBn7lz3 fYo3Sxgtq9ndotRrU783H9Z0SGyZ2KpT3xxETMusu/SyeXcAVHfyX4p56 gTTPrgSMzucrx6Aq5xXNxhxW81MXwB5/ygFjYtIr8sObYhW8EjZU8Uejp 8=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 02 Jun 2022 13:32:52 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 13:32:51 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 2 Jun 2022 13:32:51 -0700 Received: from [10.110.9.238] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 2 Jun 2022 13:32:49 -0700 Message-ID: Date: Thu, 2 Jun 2022 13:32:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v4 1/2] devcoredump: remove the useless gfp_t parameter in dev_coredumpv Content-Language: en-US To: Duoming Zhou , , CC: , , , , , , , , , , , , References: <338a65fe8f30d23339cfc09fe1fb7be751ad655b.1654175941.git.duoming@zju.edu.cn> From: Jeff Johnson In-Reply-To: <338a65fe8f30d23339cfc09fe1fb7be751ad655b.1654175941.git.duoming@zju.edu.cn> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-7.0 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,T_SCC_BODY_TEXT_LINE 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 6/2/2022 6:33 AM, Duoming Zhou wrote: > The dev_coredumpv() could not be used in atomic context, because > it calls kvasprintf_const() and kstrdup() with GFP_KERNEL parameter. > The process is shown below: > > dev_coredumpv(..., gfp_t gfp) > dev_coredumpm > dev_set_name > kobject_set_name_vargs > kvasprintf_const(GFP_KERNEL, ...); //may sleep > kstrdup(s, GFP_KERNEL); //may sleep > > This patch removes gfp_t parameter of dev_coredumpv() and changes the > gfp_t parameter of dev_coredumpm() to GFP_KERNEL in order to show > dev_coredumpv() could not be used in atomic context. shouldn't you remove the gfp parameter to dev_coredumpm() as well since it is actually within that function where dev_set_name() is called which cannot be done in atomic context?