Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4405061ioa; Wed, 27 Apr 2022 03:10:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtgB7PG1k8CYLrKd8+sX6jAjigl0VOMrnUmT91l+kNE6rwR2+rgXyE7OLWRqBna/TOa3Zi X-Received: by 2002:a17:902:70c1:b0:156:16c0:dc7b with SMTP id l1-20020a17090270c100b0015616c0dc7bmr27990231plt.85.1651054207179; Wed, 27 Apr 2022 03:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651054207; cv=none; d=google.com; s=arc-20160816; b=dDOC9Y5F+LR60J5PiQA4dse7t9f6ocQrtVJiG1WIo8SPZQVvBs4l4IkJAfiAXKe6c2 KN+tmTFc9GK7dRHvvvDRh18vQuP36W2MO6KZMjOeoLwyx8KUEZ8Kv6XeJKwudzmKBM0l TBsArhrin9b5tgqilJbzRCTYoC/6oekEo9TCxwf2eVPqn6yZUR+NFQ5dcUSbqofyj4Pt 8cOGEGOZWXx//+CUmdax2suTwOiGKFk+LogfYinyiI7F1tk2QO6TiMhEWXyFmKUTI9sl xpMR8z0TWHdna+8N8WQlRPelBjhOCYqDwjpeXwUHmL7V008mNQmyA2CsDnLVnuq6IEI4 bSfA== 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=iZ0TXjmMThX0L3lTUqlAA5brY4dwXaaXq+sou7uxL8s=; b=Dc3YAoZI8eGJKAk8lOHA8g06OvxTHRqaccmQo8dZ5TfVzopJWq7PCcf6/9+5v3m875 pHVMGNWEzw65RIFqDR9PTfBDplfSrXdGIr8mrOiVzWooMDuOTbuiRrs5Q0jOgppbq0cD MTOTBouKi1bfCjewpV0IuflyavThKbLb5jRp3TGZP5oixWCAn2TcZT6sfMW0SYW0sEj5 H5YNOk8M+p2wfLeAX/2eynP+JAzrqTGqYnsrwmBJt7/1VTyMYXui3ELDqXKG0tlBeyw0 Lfya6yl9eTILECoeNXCTNx/y64TLnpMGvWp6C2HTxk6Nnl9GHA2N4mSuUX0R5h3AivFD sZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=voqJWvGI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pf6-20020a17090b1d8600b001da8adef986si41891pjb.178.2022.04.27.03.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=voqJWvGI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 341542524D8; Wed, 27 Apr 2022 02:32:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351437AbiDZOHr (ORCPT + 99 others); Tue, 26 Apr 2022 10:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351441AbiDZOHc (ORCPT ); Tue, 26 Apr 2022 10:07:32 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4188198C78 for ; Tue, 26 Apr 2022 07:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1650981859; x=1682517859; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=iZ0TXjmMThX0L3lTUqlAA5brY4dwXaaXq+sou7uxL8s=; b=voqJWvGIbLptb6DCHgS5PW4Vbhip9bNr9lVHA7vP7+3MHg/JXIPIIXYE dY0WXPcwgLI+ev+6asO2ZQRhuK87WOlr9OBROBw8oVPHp3v33kj7iKQJe kFXqbufHs8ghaz8xJr2SdmyNOjOC6YAoACAXs5UJf5lGnbEtQtJRIee0e Y=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 26 Apr 2022 07:04:19 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 07:04:18 -0700 Received: from [10.110.67.93] (10.80.80.8) 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; Tue, 26 Apr 2022 07:04:11 -0700 Message-ID: <13df1664-fc52-4772-afa1-4f75019b7830@quicinc.com> Date: Tue, 26 Apr 2022 19:34:07 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 ] devcoredump : Serialize devcd_del work Content-Language: en-US To: Thomas Gleixner , Johannes Berg , CC: , , , Kees Cook References: <87levt14kn.ffs@tglx> <8186de033c87f0cdec296ae272a72c5b9a2880a3.camel@sipsolutions.net> <878rrt0xa2.ffs@tglx> From: Mukesh Ojha In-Reply-To: <878rrt0xa2.ffs@tglx> 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 nasanex01c.na.qualcomm.com (10.47.97.222) X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 4/26/2022 1:07 AM, Thomas Gleixner wrote: > Cc+: Kees > > On Mon, Apr 25 2022 at 19:19, Johannes Berg wrote: >> On Mon, 2022-04-25 at 19:00 +0200, Thomas Gleixner wrote: >>> >>> Johannes, can you please explain whether this immediate flush in >>> disabled_store() is really required and if so, why? >>> >> I don't really know, as I remember that requirement (or maybe even code, >> not sure) came from Kees, who needed the lockdown. >> >> Given the use case (ChromeOS?) I'm not sure I see a need to flush all of >> them, since I guess a typical system would set the lockdown early in >> boot and hopefully not have a crash-dump around already. >> >> That said, I don't think the diagram you made works - fn() during the >> iteration is guaranteed to be invoked with a reference of its own, so >> the put_device() there can't be the last reference, only as fn() returns >> you'd put the last reference *there*, freeing it. > > Bah, you are right, it's magically protected by the klist ref, which > prevents devcd from going away. Damned obvious. > > This really needs comments why this all can magically "work". > > Thanks, > > tglx > Thanks you all for your time in reviewing this. I tried to address few comments in v3 here. https://lore.kernel.org/lkml/1650981343-11739-1-git-send-email-quic_mojha@quicinc.com/ While, we would like to hear from Kees about reason of immediate flush from disabled_store(). Regards, -Mukesh > > >