Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp807843iob; Wed, 18 May 2022 13:30:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqvSMxGgOLWITQY4o0bwapp6q/ah18/NIqU9LYctQd5MM2LJiXMnlsWg05ASw1jq18EyOD X-Received: by 2002:a17:902:9a42:b0:158:bf91:ecec with SMTP id x2-20020a1709029a4200b00158bf91ececmr1392995plv.115.1652905833052; Wed, 18 May 2022 13:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652905833; cv=none; d=google.com; s=arc-20160816; b=WdEn/vXcVNVRSLhrDIZqxKuINPDPCRIiykPyprHzKMqBwr9Q0SRZIph+tYuxgIijv2 SxaYb0z8+c9kGQffNkUvvuhg5qNxRyGSRpMnL24aA0ankT88/OelDbSTMizInP9uU+T5 LaiL/bF0X6VAyhv+nPIwAjS+aIkx1dIjmh7TAg4qwhjb5RBrDoG7Jqb9KAMLh8Jd2kD4 0UkbvxFSF0KeJ9mG6FRBY3CrR2skRl5JvbIhNlydB+Qet7zG/xIPynoElRzja0U/Cwcq WgnnVUQyVO1XTYM+Q1Bq9/GmPgFjhoK9cW+mHXmdvSBvA/Pe0//rJ87KgmoRTs7nskTl 38jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=cO7il1EbGLDAsi9btfMK56EFMu0vOnZ/hpfwtqzjMgo=; b=gqIUDZHCTVtb7VPzAv3By/UoWEgwRPrJiGjnSqeaPlsXFGzvnTk68B/5IzlawgGBQD eWEDOpEYspUAGteGJwFu5lU3KOMeLaF51ubBIu3fRLDiSdcih8ij1jGbZN7P0eJgCRZ6 IB3AnqdWheBsfnF+cB5eYIFjpulIRbGreIDvtNnI41Pd7GUosCfcSYseYiLwlHCTlj72 4C+i0yHlTzlDUo/jIsQNU6LLlG7pxmboRWRybykul1wTy32iVd8F869MMunJXPW3I7ia QXxASwK3V1P1FJzJlOCYXchGgSIk496DFY/EfPhFX3Q6vmauGno3vLiEahdLLvMcd6rz DIMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=MG0OjiK2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k6-20020a170902c40600b0015eb6621630si1661183plk.307.2022.05.18.13.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 13:30:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=MG0OjiK2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EC24C131F14; Wed, 18 May 2022 13:27:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242595AbiERU1Z (ORCPT + 99 others); Wed, 18 May 2022 16:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242599AbiERU1U (ORCPT ); Wed, 18 May 2022 16:27:20 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB97C131291 for ; Wed, 18 May 2022 13:27:19 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id er5so4404656edb.12 for ; Wed, 18 May 2022 13:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cO7il1EbGLDAsi9btfMK56EFMu0vOnZ/hpfwtqzjMgo=; b=MG0OjiK2mlF4yW3YO6xj8BEA/URIDRgGe/IpfnWs0ugc9usajjC7Cvu+Hj7cSFPFuZ lcShlak7TwSLbCj+pvyRfhoDg7Fud6ndoRkL1czNwgEphhoy/CBRQ6UM5doJVWTltHCu rhZAyV9veHVVjzwWWUnb4UQtt4qHCoAiY50XA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cO7il1EbGLDAsi9btfMK56EFMu0vOnZ/hpfwtqzjMgo=; b=5tVSKxbWzMLINvlYUlrKuNWIyHl7imO8IxlTp2iVl7AJUvm6vt9Y2sRwpr/MlPv8Uk QRdKamhnoCJk8qC4iZjHg1lrtdluDb/Wc/rP0w5MsE71ZSJTTHwLwwM8JHmJez8cZD1j NUDVBpmnSZSYjSPibClOggaOQuI/BWDeq6P+jYhInEBUWQDaeStou8lXa2yAH3yTPfku jn3babwNs5TC8f+hpPTG6tHOdApmsOJb/j3ehnJ+AwbfE/GdMBLsA32BFtC9ag7BeV8C truMYcKBLxRPG4GiH7Vg8dFkxdCpLZYt+1lCyZyAfGaCaoi4Lrk6IRwv8zEfKNQ4QcbG 0eaQ== X-Gm-Message-State: AOAM532W9M+FagJxiJOOrnSY5pVJB3YIsBVeYVXremP9o94ZzRotZkxs 6gu2ISGP24qsT3EI5300xUtoQKpFU/KVmzhP X-Received: by 2002:a05:6402:5190:b0:427:df4a:19d9 with SMTP id q16-20020a056402519000b00427df4a19d9mr1666103edd.384.1652905638464; Wed, 18 May 2022 13:27:18 -0700 (PDT) Received: from localhost ([2620:10d:c092:400::4:c43c]) by smtp.gmail.com with ESMTPSA id f26-20020a50fe1a000000b0042617ba63c9sm1894857edt.83.2022.05.18.13.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 13:27:17 -0700 (PDT) Date: Wed, 18 May 2022 21:27:17 +0100 From: Chris Down To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Petr Mladek , kernel-team@fb.com Subject: Re: [RFC PATCH] printk: console: Allow each console to have its own loglevel Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.4 (c3baa83e) (2022-04-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Greg Kroah-Hartman writes: >> If you're talking about properly freeing the memory, I suppose it should >> happen by doing something like the following in unregister_console(): >> >> if (!console_drivers) >> /* free the class object under console lock */ >> >> ...right? Let me know if I'm misunderstanding you. > >You can't do that as the driver core should now be managing the >lifespace of that object. You can't "know" when the object's memory is >to be freed EXCEPT in the release function. > >So free it there please. > >Or do not tie the lifepan of the console class device object to the >console object, and keep it separate. I don't remember exactly how you >tied them together here, sorry. [...] >> > Do you ever free the class? >> >> Currently no. What do you think about the above proposal to do it once the >> console driver list is exhausted? > >If the code can never be unloaded, no, don't worry about it. So just so I understand, there's no problem here if we're not going to free the class object, correct? These two stanzas in your reply refer to the same thing, right? For context: the class comes up with printk, and printk can never be unloaded, so the class is never freed. The devices that attach to this class are stored in `struct console', which has its lifecycle managed externally from this code. I feel like I'm missing something here, but the two quoted parts of your reply seem to contradict each other (the first one talks about the right place to free the class, whereas the second says it's not necessary to free the class), so I'm a bit confused.