Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1670780pxb; Mon, 12 Apr 2021 04:01:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzttSJe/M69AIi2cpj7QvtxMbbsxIZg7yxe2egWmrGeqyUnphdZZxY/DUCDOWin5rR2yEox X-Received: by 2002:a17:90a:4615:: with SMTP id w21mr28383645pjg.50.1618225303380; Mon, 12 Apr 2021 04:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618225303; cv=none; d=google.com; s=arc-20160816; b=IfdlPlB/ZwUTycSlOBFklLsHnd1c5/2oCEDNhqbYO0HIeHK8Idt2obxcGFycjkjGHN HxKeW1eIFE0nLk2Sood7IOv5hodyHGGPKU0YRMnXhiTRtWpd82en3xvCSkPrk7h9sKaS IWQvd7gOaqLg5pyepWCeHT1GgrwTVizkjyDiyP6IqQLWQB41wS0etVo230OxSVxc+NlU 7JPHwCnSO30R2K5X5/VeCsV4Nnzj430RwEA4mUn9yUy6wwX0WyGbPSX0wGD5+LPJYJzc jpWi9ePfcrmbP2w6oH2I/iEOMdbFlBemJh3Yy0BOESaspzM8E3iesvaxUYdaOvcDXIiA adQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FIwJ2o1ChvUTQac2QV6kY4C/JqzebedAs3YH2KsUrwk=; b=HaFOdIxwIiDChwwWunXhxTJ50oKr/ny7sOXrQVPQ6NQoGisW4q32hpVcAwCxK3aO2u BTNcEUtmjt2XpG7J5yvirQ5LC+TKkwVaNwUi+Z4gbikLpsTRN8T29K0cBRzyGsuV05Wu BH2E1m3FjaVB1MPLXu48Sh5HDD4+ADLMX8KaMyMzRD+2TsN4pMXq4Td7bn8dsvJwIEs8 Ge0d4VXktNS7WyD5hGwtvuUAjwrdMofWXMhs3Zo1j5F/+DZRMoPEYupn4jlJMwbRCQoA jkS/mxBS4pSHjLuXqOhZQDr7ihZiDnFE6xthgNaxqlKSKFnI8UTmS0jl1dU2bXU16you HehQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=uQXF9AGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot14si13111434pjb.55.2021.04.12.04.01.28; Mon, 12 Apr 2021 04:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=uQXF9AGn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239859AbhDLLAK (ORCPT + 99 others); Mon, 12 Apr 2021 07:00:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:52648 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239843AbhDLLAJ (ORCPT ); Mon, 12 Apr 2021 07:00:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1618225191; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FIwJ2o1ChvUTQac2QV6kY4C/JqzebedAs3YH2KsUrwk=; b=uQXF9AGnwE8HshC8CP3Jun+axKZdGLySEhwpcbWGJ7G2LHJi1HDujPh78vSSRndZ7LY4Ir voyMDDET7bbqJ/RrmB1sEhmVrnoD5enId5gB+SOFJALpflmMcQcdnou3PaS5MUBJkaggMP LnNFj32K0RIzJWwuqYM7vw78d9fBPfU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 41133AEFE; Mon, 12 Apr 2021 10:59:51 +0000 (UTC) Date: Mon, 12 Apr 2021 12:59:50 +0200 From: Petr Mladek To: Joe Perches Cc: John Ogness , Alexander Monakov , Paul Menzel , Joerg Roedel , Suravee Suthikulpanit , iommu@lists.linux-foundation.org, LKML , Sergey Senozhatsky , Steven Rostedt Subject: Re: [PATCH] iommu/amd: Fix extended features logging Message-ID: References: <20210410211152.1938-1-amonakov@ispras.ru> <87o8ekioo4.fsf@jogness.linutronix.de> <9a9246c417587f17009543f8048d5f9b7a2ed68f.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a9246c417587f17009543f8048d5f9b7a2ed68f.camel@perches.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 2021-04-11 14:08:14, Joe Perches wrote: > On Sun, 2021-04-11 at 21:52 +0200, John Ogness wrote: > > I'd rather fix dev_info callers to allow pr_cont and then fix any code > > that is using this workaround. > > Assuming you mean all dev_() uses, me too. > > > And if the print maintainers agree it is OK to encourage > > pr_cont(LOGLEVEL "...") usage, then people should really start using > > that if the loglevel on those pieces is important. > > I have no stong feeling about the use of pr_cont( > as valuable or not. I think it's just a trivial bit that > could be somewhat useful when interleaving occurs. > > A somewhat better mechanism would be to have an explicit > cookie use like: > > cookie = printk_multipart_init(KERN_LEVEL, fmt, ...); > while () > printk_multipart_cont(cookie, fmt, ...); > printk_multipark_end(cookie, fmt, ...); > > And separately, there should be a pr_debug_cont or equivalent. We would need to implement this a lockless way. It is doable, for example, using some per-CPU X per-context buffers. Which would require to disable preemption in the section. But I think that using dev_cont_info() would be easier after all. That said, some printk_*_init()/end() API would be useful for storing the pieces in a temporary buffer. It would allow to store the entire lines without the risk of interleaving with other messages. Best Regards, Petr