Received: by 10.223.164.202 with SMTP id h10csp144446wrb; Wed, 8 Nov 2017 13:34:25 -0800 (PST) X-Google-Smtp-Source: ABhQp+TYpfWzvk4ZubFDxg76SZQypcFisnC4tOz+7UyBqvYEmklyMMOoPDsCImBZ8YmjjP4w3kp1 X-Received: by 10.159.244.18 with SMTP id x18mr1671246plr.338.1510176865472; Wed, 08 Nov 2017 13:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510176865; cv=none; d=google.com; s=arc-20160816; b=dDoemsoPLy5KHKlVTIWuFJYPIvGybIS/C2H87rtprJ2gXX8OGPTX4xbrzZutTWMNhI JFzU07xES/PkylUqh3H5DcxHOMsJpwGnoKPJS37S4p08Qfv6DM4Nx0Cee7zB6q8FoUWC e9rW5Dda0zJVn8DauEjZ2r6ekvKYwL0dazDJrGjswvwbkL1rvOdvvwCY4v5XVLb9h1dj tlZfcpfNmweiOP+7fVCmSyMAPZ91qJQnZ9K9DGgFCUT+BWchfjVevUNYYdyBsuzGtjYO ANClnO3FNCX7m/N4hRlM2oKZG4YozuwWqnSJ9BU1Bejm24VI1EuIDRIxCJaZLHCEyJMN P1Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature :arc-authentication-results; bh=stwXNpiB8gdk89fJkQpePXTbuDp4J7iJ+rRrv8R62+I=; b=TKNG8lZfZbVF13oSaMaDA+a+vJ9tmP9CXMCgWZuonuVO2iobS0RnNqEKhVel+m9s0p ZNTChGjp19OZg5wq1lyxl4QMYEJ7qkCR3N4EPWbxvD5E5gI/wPHYQ774c+0InLAF/17q qtIcs+GzrVSU84F9+YhN20jaKzHEya3aK2tO4UQgVAgvU4Kqkw1X5u0Kz2uq4mk/tdbl mKcyfUKiTxd02Yz8oZYEmwvG9VOBD/3plyf8JDk/1uffy/fXjRXZoVztppWNRaAP+uyE KCUNhR7NA7+YMxaNloL37Xhj7SkvYBcRZw7GZE4X0fFlPzry8nXVTg8Ft7+FFOeVwA+D 0vLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=RFvDISNu; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=N/N0aety; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t202si776215pgb.548.2017.11.08.13.34.14; Wed, 08 Nov 2017 13:34:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=RFvDISNu; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=N/N0aety; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbdKHVd3 (ORCPT + 84 others); Wed, 8 Nov 2017 16:33:29 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:54808 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbdKHVdZ (ORCPT ); Wed, 8 Nov 2017 16:33:25 -0500 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA8LX0we016207; Wed, 8 Nov 2017 13:33:18 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=stwXNpiB8gdk89fJkQpePXTbuDp4J7iJ+rRrv8R62+I=; b=RFvDISNun9UYNN8SNaI7UXBnNmnIGmek/R4u3YCF2ppV+n5JECP94mkNiZiAS8xIXvq6 3AfNgw7+9a2lVixQ9eCZ8lViaBumElJEdXjkNnZMn5AE61IxSRpM1z6QlCY++QL9dx+m fxKXALjsEWB1+Vu7Yth9ViLxCx6Y81UAH2M= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2e47g1rr7q-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 08 Nov 2017 13:33:18 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.25) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 8 Nov 2017 16:33:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=stwXNpiB8gdk89fJkQpePXTbuDp4J7iJ+rRrv8R62+I=; b=N/N0aetyzvKaNUJqxE0t7kCYX9ehuoIfq7qsmjIkp12qpVWML+MpLNNn4jGffUFUHKTznZTxx5vDuanvkLhTsPhP1qIMsKxnCKiJlkk+dFVd2nXAM2v/BLO0cD7IPQzRMxxM4UvGDl4KcKiqTgLQiqRPf4MxbBwCJnoywng1HiQ= Received: from [IPv6:2620:10d:c082:10e2:f854:b4a:e5b7:56db] (2620:10d:c090:200::6:e4c2) by BN6PR15MB1219.namprd15.prod.outlook.com (10.172.205.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 8 Nov 2017 21:32:57 +0000 Subject: Re: [PATCH 2/3] printk: Add /sys/consoles/ interface To: Kroah-Hartman , Petr Mladek CC: Sergey Senozhatsky , Steven Rostedt , , , , References: <08c1dc1a96afd6b6aecc5ff3c7c0e62c36670893.1506644730.git.calvinowens@fb.com> <20171103142114.GG31148@pathway.suse.cz> <20171103143234.GA7801@kroah.com> From: Calvin Owens Message-ID: <519f471b-47dc-3367-f702-119a9d82ba9b@fb.com> Date: Wed, 8 Nov 2017 13:32:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171103143234.GA7801@kroah.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::6:e4c2] X-ClientProxiedBy: BN6PR1801CA0027.namprd18.prod.outlook.com (10.174.119.168) To BN6PR15MB1219.namprd15.prod.outlook.com (10.172.205.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67e55eac-1f9c-42c0-d045-08d526f047d0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:BN6PR15MB1219; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1219;3:FyrKQlkh+TpzNTJ04xVR/yu/X/3CfV7+AlgtprB4vWJMNRYXEsvMbv6g4r7LRSUjqTjXnKKjOA2VR8Gpd2lAvVEkGbFQ5IYw935b/e10pd6SJBQbCtBDIVRy2/E3A/RqpJlmcg0ceVyrcAzDp2BUuisK6p5ZDvhCys3yG+4uphvTX/zsJ/0vsOjEHNK9AT9Fw3FHb3Y4qbQKuyCJ8PFmTrJIwheUq5n/kIy7+O+jaIUwdacL8oVxDb1WbpCjts7B;25:aozFx7TCMf5BIWlNy/kHs8o1S7GWzeQw1NeeTdPErRwngmtGD4FJ+YXWco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ky+J0nfbWGO3se7JIvBvVQMxVVHeLQgBSWohGupN;4:pKDSoWgBNtBJuFvNXfmwOtdI2PpV6IEYOWyEnHmKIyFcWqrqSR5JjmTsfjlhiCDLwzKaO25R2Jm9/Cz3iink07GMbAigWqqnHz+viKziKLmgu77+SEZ9Ix/6WuoJNax7yGXAmgzCZUoAyQy+4NWRY4VhFGNDsUu3v6SuezEOcIZlwEkEgNDXb2ezjkmMd0lTENU5s1EKEqyZ/LgVe/WjFqfipJztpKADcJRZNH4wiY8hHlIgWevYSXg8DrfvKRwINuhUa0zU1l+8SH59ZorCQR1jsHze5UJKFc/GnQs277VkgDM0w8ZqkDGR1EaGguRu X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231021)(93006095)(93001095)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR15MB1219;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR15MB1219; X-Forefront-PRVS: 0485417665 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(376002)(346002)(199003)(24454002)(189002)(377424004)(50944005)(33646002)(23676003)(67846002)(54906003)(58126008)(2950100002)(110136005)(6666003)(93886005)(316002)(31686004)(7736002)(31696002)(305945005)(39060400002)(5660300001)(4326008)(97736004)(47776003)(25786009)(86362001)(189998001)(53936002)(229853002)(83506002)(50986999)(64126003)(230700001)(50466002)(6246003)(8676002)(65806001)(65956001)(76176999)(1706002)(6486002)(54356999)(106356001)(105586002)(8936002)(2906002)(81156014)(81166006)(101416001)(68736007)(6116002)(478600001)(65826007)(53546010)(36756003);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1219;H:[IPv6:2620:10d:c082:10e2:f854:b4a:e5b7:56db];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjE1TUIxMjE5OzIzOlBnUDNJYUNGeHhxVGljZUN0Q05qekRWejg5?= =?utf-8?B?Sk16V1JwZ2YwV3hmUTBPOHI4MlVQK1FMREd2eFJzbERTVGVSYyt5SENCNXR2?= =?utf-8?B?RXpmb3l6cE1LSGl5OGZNb0hFOGxNOVFHNzBqTkxFSE83dnErSnpLTmdncEIz?= =?utf-8?B?SzQwODUwZWQrU3pyNEoxYThZaDB2MS9iRmNkZVpKSnVwVmZ0NTNya3I0NS9H?= =?utf-8?B?SVJobVdIZ0VrTEE4WXl1WTRKRlJsTzBtclZiZWZDVExuWGRUQUcxVXI0V0tr?= =?utf-8?B?NDMrZlVSMCtyOFhSTUhLTW5nYXQvUXR1QUFmakhLMEo2dWgwVVJtVUpQOTVE?= =?utf-8?B?UnV4dzNwWDM4QVllRWxCZnFZZGxjWHFVWExsOGFrWmd4UWxadkVocEZTU2d3?= =?utf-8?B?UjR0T2xPVW00YnR6bjRON1FNSW04V1dTZ1JaTEhFRzNZZktyUHlKSVJuTG5P?= =?utf-8?B?R0JvWW1YdStvTFZJQ0dGc0NJeUVLZFBvd2RCYVplMEtickZPcUJ0anRKUUxT?= =?utf-8?B?dExKcVdQdTJDWWF3N0NWcWVtOE5YL0dmR2ZEMHBiWUcrTWFoWGhNcFJjT3NC?= =?utf-8?B?a0VQaDhBcVV4akJsb1I5LzFmME13SzMxMS9HaXBCSFVMUTBheExqZjhYOSsz?= =?utf-8?B?dS9rVC9vKzJ5TW9ZN1VG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NhIDTt4hGyjAUaF3A+Y2miLQER00frQPHP/p19oDU5GDsMg+h2OWGDet6k+ArsYcSiD6qOhhEnuSsfLjeJ/Gb2E+fdqJ9SHopdodSwMHVe430EXPzQQiP14ca4KT7sulE+JR44HFVhN241gAg+y5gP0UsHhyVQ6Dh3jW5ALK6dki66WgvtnnsbR/7xBt718pIyRB8ij5IhdzCff9iD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1219;20:J1FWwsYfjvn9PAZAOPjcxoxWvqFkMSmbHEjnYD9L5W8UEdPKfQaaXrWePRacGXLhdRC/B1yyZS9agDaguLXoVfOgFxRb2clfwseGI8dnV+4CGeMw1Q//gn0yzqI4fQIkbFBszdy5vodacf52xMWCIrF4rCusorTFrzQot3v0YMc= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 21:32:57.2604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67e55eac-1f9c-42c0-d045-08d526f047d0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1219 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-08_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2017 07:32 AM, Kroah-Hartman wrote: > On Fri, Nov 03, 2017 at 03:21:14PM +0100, Petr Mladek wrote: >> On Thu 2017-09-28 17:43:56, Calvin Owens wrote: >>> This adds a new sysfs interface that contains a directory for each >>> console registered on the system. Each directory contains a single >>> "loglevel" file for reading and setting the per-console loglevel. >>> >>> We can let kobject destruction race with console removal: if it does, >>> loglevel_{show,store}() will safely fail with -ENODEV. This is a little >>> weird, but avoids embedding the kobject and therefore needing to totally >>> refactor the way we handle console struct lifetime. >> >> It looks like a sane approach. It might be worth a comment in the code. >> >> >>> Documentation/ABI/testing/sysfs-consoles | 13 +++++ >>> include/linux/console.h | 1 + >>> kernel/printk/printk.c | 88 ++++++++++++++++++++++++++++++++ >>> 3 files changed, 102 insertions(+) >>> create mode 100644 Documentation/ABI/testing/sysfs-consoles >>> >>> diff --git a/Documentation/ABI/testing/sysfs-consoles b/Documentation/ABI/testing/sysfs-consoles >>> new file mode 100644 >>> index 0000000..6a1593e >>> --- /dev/null >>> +++ b/Documentation/ABI/testing/sysfs-consoles >>> @@ -0,0 +1,13 @@ >>> +What: /sys/consoles/ > > Eeek, what! > >> I rather add Greg in CC. I am not 100% sure that the top level >> directory is the right thing to do. > > Neither do I. Sure. This is a placeholder I choose arbitrarily pending some real input on the location, sorry I didn't make that clear. >> Alternative might be to hide this under /sys/kernel/consoles/. > > No no no. > >>> +Date: September 2017 >>> +KernelVersion: 4.15 >>> +Contact: Calvin Owens >>> +Description: The /sys/consoles tree contains a directory for each console >>> + configured on the system. These directories contain the >>> + following attributes: >>> + >>> + * "loglevel" Set the per-console loglevel: the kernel uses >>> + max(system_loglevel, perconsole_loglevel) when >>> + deciding whether to emit a given message. The >>> + default is 0, which means max() always yields >>> + the system setting in the kernel.printk sysctl. >> >> I would call the attribute "min_loglevel". The name "loglevel" should >> be reserved for the really used loglevel that depends also on the >> global loglevel value. >> >> >>> diff --git a/include/linux/console.h b/include/linux/console.h >>> index a5b5d79..76840be 100644 >>> --- a/include/linux/console.h >>> +++ b/include/linux/console.h >>> @@ -148,6 +148,7 @@ struct console { >>> void *data; >>> struct console *next; >>> int level; >>> + struct kobject *kobj; > > Why are you using "raw" kobjects and not a "real" struct device? This > is a device, use that interface instead please. > > If you need a console 'bus' to place them on, fine, but the virtual bus > is probably best and simpler to use. The problem is that the console corresponds to no actual device (this is what Petr was getting at in the other mail). A console *may* be associated with a real TTY device, but this isn't universally true (for example, see netconsole_ext). Embedding a device struct in the console structure is problematic for the same reason embedding a raw kobject is: we'd need to rewrite all the code to deal with the new refcount/release semantics. While that's certainly possible, it ends up being a much bigger thorny change. If we deal with the "get()/deregister()" race in a safe way, it becomes very simple. (If it were as trivial as replacing kfrees with puts and adding release callbacks, that'd be the obvious way to go, but of course it doesn't end up being that nice...) > That is if you _really_ feel you need sysfs interaction with the console > layer (hint, I am not yet convinced...) How would you expose this setting if not via sysfs? All I care about is having the setting, how exactly userspace pokes it is not at all important :) >>> }; >>> >>> /* >>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c >>> index 3f1675e..488bda3 100644 >>> --- a/kernel/printk/printk.c >>> +++ b/kernel/printk/printk.c >>> @@ -105,6 +105,8 @@ enum devkmsg_log_masks { >>> >>> static unsigned int __read_mostly devkmsg_log = DEVKMSG_LOG_MASK_DEFAULT; >>> >>> +static struct kobject *consoles_dir_kobj; >>> >>> static int __control_devkmsg(char *str) >>> { >>> if (!str) >>> @@ -2371,6 +2373,82 @@ static int __init keep_bootcon_setup(char *str) >>> >>> early_param("keep_bootcon", keep_bootcon_setup); >>> >>> +static ssize_t loglevel_show(struct kobject *kobj, struct kobj_attribute *attr, >>> + char *buf) >>> +{ >>> + struct console *con; >>> + ssize_t ret = -ENODEV; >>> + >> >> This might deserve a comment. Something like: >> >> /* >> * Find the related struct console a safe way. The kobject >> * desctruction is asynchronous. >> */ >>> + console_lock(); >>> + for_each_console(con) { >>> + if (con->kobj == kobj) { > > You are doing something wrong, go from kobj to your console directly, > the fact that you can not do that here is a _huge_ hint that your > structure is not correct. > > Hint, it's not correct at all :) I understand this looks like a common antipattern, but it is very intentionally done this way to avoid the issues mentioned above. > Please cc: me on stuff like this if you want a review, and as you are > adding a random new sysfs root directory, please always cc: me on that > so I can talk you out of it... Apologies you were missed, I'll make sure you're on the CC list for future revisions. Thanks, Calvin > thanks, > > greg k-h > From 1583061109803518806@xxx Fri Nov 03 15:58:41 +0000 2017 X-GM-THRID: 1579832740601012796 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread