Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp133112pxu; Thu, 3 Dec 2020 22:19:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9UzClBfhrWfXcquS7kG2hyAMFn+rmlJSKVE0jt+mMUQfmZ1p5hY3MCjPQkcoP8GPlpkHy X-Received: by 2002:a05:6402:48d:: with SMTP id k13mr6063109edv.92.1607062767613; Thu, 03 Dec 2020 22:19:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607062767; cv=none; d=google.com; s=arc-20160816; b=jI6NwXWhR63BPQoR8K3aGB4MYBw4gk4Y7wZQJAAC6Dr2F7w/WOSHzqpYnLmCrwWfrM yK5l/7tVQVRvYaPCN36+NOpOIvEpw8uSev1iexZFZJ55YmSFq7VGcqBLTo9c7GwRjNf/ Btroa+uE9jXvILiutU+O5bYNiuIZ8N/pRkPzpn5hMRfvQZZBpBxh+H+2n3009ip0sAG4 w0QyvZJjDbJcuPAebuaRX0iRJ2aye4mzItz+BfBaeFPivnvLxt5HTDYPufZreX8XoxrX QWLz2ersYE8AYGWuTWdZOlUSjx1+jyujeeEnYQCPloTYMbaE+qBW2j7JYeI1Edo0HHZu T0TQ== 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=ikYQZkKBQlj1XLSG/m2Nj6ANcmyaZPlsohkob6g2/r4=; b=aPsHVbhrWwuqwd2WQKtV1c6R2iy+wVbmOteDKeRrj7Bzqk2X2kADjKWsshviAc8MR9 7ZF519BADIF+IUq4HMMiaRrbjURlg2084xuosHKZxbzZznGQHmMjC8HL+C32CjPRm80Q p5yoQFlwVqy7sxtk3/EMEy4CnHWsMRC0vOTYgvoaZA4oTEx8/0qcLDx8CG00VNNNx8jw UZGVyfnyJwG0SoojV2Q2qMMNn07rurjfCaI5Lpqyk0aWyX07ePhaINwV7Bv1opD7cNmM sm4TqBsrdJI8zYZdGAFlUuszE46fE3eKeCjxO7LmMC1vW3lJL9otruBB4kvdhjZG6lH+ pjuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rZE1jJcB; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si2433228edr.303.2020.12.03.22.19.04; Thu, 03 Dec 2020 22:19:27 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=rZE1jJcB; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728014AbgLDGOe (ORCPT + 99 others); Fri, 4 Dec 2020 01:14:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgLDGOe (ORCPT ); Fri, 4 Dec 2020 01:14:34 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440A7C061A4F for ; Thu, 3 Dec 2020 22:13:54 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id f14so2479694pju.4 for ; Thu, 03 Dec 2020 22:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ikYQZkKBQlj1XLSG/m2Nj6ANcmyaZPlsohkob6g2/r4=; b=rZE1jJcBEfuG+w14l8I2r44kc5Pg4JFzND0yoE31dNmKJ4ykxnxel2jzxhbO6Hvmk3 TItDEHjF5tLTrfIhOTdCgZY2DmqUglJd3BuxS2N709P2uBoy+fM87mf0JspDGQBEp2Fk tgUxJRqUEmqvisMIZG0vQWVFMn+0HoyCD+7iIJYbltHuOqunVvtId7lHKPUFIPmNkntK 6c5icC+nMhb/f2TIQcXm997Kxdxza2ZC/Xts7ybnTrjU4gvx9Dh0zCyr8dgh70gK6MiS NejFBHJduar/zyNmg2ilV2RSnrbcv2+bJXQk0KGxGsEzG8YhZwz5aqzcNbXzyPP7te2j Lutg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ikYQZkKBQlj1XLSG/m2Nj6ANcmyaZPlsohkob6g2/r4=; b=d4lLILV4LtQdlD4ChujVuHqMkoEOY8dMP4IHawT4OTTOmn5al241CQCLrRZ9RPhwMI sxhuSI7D/NHxP0oE6dUPQAzbL6agJIz60rPG0f5I3y7HZz/caC49xjYVHCuYnsO5DSSS kS1r2oZzcpVpMvjMD/YKfSJILQTL9qIIZiNke3ryVwRU99Wuau2fnu6ak1GlUynzcW5i L2HLqOxlAtSOGB7cWDpjpf7wz4CCLNwAq6rhrtwfO6C9qGkoYRufC7GBSSygADb/+/Dc TWWnnlFGlgzSiKgPW5karI5fdjoqDQsMblhe3HVDCUnxqbG9VA7z73BD++ayG9udRvfV iZCw== X-Gm-Message-State: AOAM530nYfGCtTb4r6kT+nFVZl3VISWRb8H7IZLvT52Q9Ba8MUobQFFZ b0Iw1ExxDCHURchzdsovhjQ= X-Received: by 2002:a17:90a:f40e:: with SMTP id ch14mr2691241pjb.172.1607062433800; Thu, 03 Dec 2020 22:13:53 -0800 (PST) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id kb12sm1025642pjb.2.2020.12.03.22.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 22:13:51 -0800 (PST) Date: Fri, 4 Dec 2020 15:13:47 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH next v2 1/3] printk: inline log_output(),log_store() in vprintk_store() Message-ID: References: <20201201205341.3871-1-john.ogness@linutronix.de> <20201201205341.3871-2-john.ogness@linutronix.de> <87v9diyhza.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9diyhza.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/12/03 17:31), John Ogness wrote: [..] > >> + if (!prb_reserve(&e, prb, &r)) { > >> + /* truncate the message if it is too long for empty buffer */ > >> + truncate_msg(&text_len, &trunc_msg_len); > >> + > >> + prb_rec_init_wr(&r, text_len + trunc_msg_len); > >> + if (!prb_reserve(&e, prb, &r)) > >> + return 0; > >> + } > >> + > >> + /* fill message */ > >> + memcpy(&r.text_buf[0], text, text_len); > >> + if (trunc_msg_len) > >> + memcpy(&r.text_buf[text_len], trunc_msg, trunc_msg_len); > >> + r.info->text_len = text_len + trunc_msg_len; > >> + r.info->facility = facility; > >> + r.info->level = level & 7; > >> + r.info->flags = lflags & 0x1f; > >> + r.info->ts_nsec = ts_nsec; > > > > This is the only location where ts_nsec is used. I would remove the > > variable and call: > > > > r.info->ts_nsec = local_clock(); > > My reason for grabbing the clock at the beginning is so that the > timestamp is as close to the printk() call as possible. IMHO it is a > more deterministic timestamp than if it is taken after reservation(s) > and sprint'ing. I prefer to keep it as it is, but will not object if > such a change is necessary for mailine acceptance. Sounds reasonable Reviewed-by: Sergey Senozhatsky -ss