Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp185162pxh; Thu, 7 Apr 2022 18:14:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCBdHU64rtb8L4RYnwDx+m6UAFBbrNTU5ZuQNfTjJxCp0wYlqXG/ShUb7BkrdxcP1S+lJM X-Received: by 2002:a17:902:ab57:b0:156:c63e:9d1a with SMTP id ij23-20020a170902ab5700b00156c63e9d1amr16850316plb.49.1649380457181; Thu, 07 Apr 2022 18:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649380457; cv=none; d=google.com; s=arc-20160816; b=aMQ6B+toBHXuHWPB9hImIZmD+jeoQa8vtqxjX9KgOtA9fJOJTKkn477Z3Lp45Mwn6L T7C2DqJEqfEo/SXIkhRqgqE3XstQ9KRpmgvmSHUYsrW63spHBpozhoz7zGZrOEBj9ZA+ 54AHMZvG4l0s1TKahG6jS0dCVtR9ghrphLdQG6ERQogqlhVpZ9dLChxl/frSnKa7pWk5 JjRSffAf93Plj09UjDMjLgb1Kru9TbT+dJtGUpqRWR9Qrs1cW5CmXWm9o7u4od50APAB R4e1zDk3EEjdYSg6ZwaDcZ8+Utzu3CFb8b4UXsOsFfpxPzAwNfLT9ukz31AKc1aeFeia 4X6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9o8sGMkfG1jeyFOXZpLH64iA8m+M6x0mckBPZB78tzo=; b=mkm4MAIyCinEkZ0VeDUK43elt/5yXcvV25xX2mmdOaPZSnqw4wLAZD7iZ5NcurxuxE vt8F0Ye3SSCNhJTbKOGFqHkw6ik1e1Y4exTyyoZ3vY1Pgzzka7WXQSXUFQK0ywQGPZ6D WLIjrD4tlxx+SKzH52qaB+F/FSwaLaEb0tJ4nSVXQrFZ9qm0IHg0YXTVC0YSsRdnZ5gl uIFkWrTRZX+3Kq02Ls4E5335lPnHWPA1E3BspGXK67D6n/qd0Cio+bOaUJn6h/OUkEJF lcBl5B3up36DjZJcDT1IpCb7E4gokuLKOjEg0lyT0GXohKlfTJs/7hMYk8wt7Fj2Q6sq K9Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fxTAOs+G; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d17-20020a17090ad3d100b001c61582eda2si3106180pjw.165.2022.04.07.18.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 18:14:17 -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=@google.com header.s=20210112 header.b=fxTAOs+G; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 071CF180239; Thu, 7 Apr 2022 17:45:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233024AbiDHArN (ORCPT + 99 others); Thu, 7 Apr 2022 20:47:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232997AbiDHArK (ORCPT ); Thu, 7 Apr 2022 20:47:10 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A40B53E2A for ; Thu, 7 Apr 2022 17:45:08 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id l14so12511645ybe.4 for ; Thu, 07 Apr 2022 17:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9o8sGMkfG1jeyFOXZpLH64iA8m+M6x0mckBPZB78tzo=; b=fxTAOs+GhjoaxPxbBlMf896vsg3DjAYfwRkWhqPKYkU/sU/QX3SYpF369qI8oRsdnW woLa1QozV/d9z0eC9L3JU/0A+aribrkLH4ztc8jw9lhQWMxS831uV9ppubc/d7bKXugU QyXyl7Jl58hSrjCPIAWBgqpbZSSFH9bXGL7Iv9NKhx2qKgbkgNI8CS8difiT5eT+VRON ENZErFFpoqSvrsSZLFYAYlYR+kSB6/W3/6XL2Yqs/xTN9Wxgv3GTOSQWi57eBWVdeuCX dypxNXfkTBmDeW9jVyd+lnOuFdt65mBP3eWqWRUNxyKCfIaAO+mulasGqNdVNJUDjAfG TYug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9o8sGMkfG1jeyFOXZpLH64iA8m+M6x0mckBPZB78tzo=; b=ws3yDys0f2mQz9uqKJngJCSmNvlictURylYI4HD9zqMwpOW3oANxgyX3h4z45UEQQ4 1xflLZYkAH7BEN63lDyxQjbkpHy9jWT81SO5Mg6Olj950TmmPR3TY/TCIj78Ud9zt46T lvOZjhFzLoQ+LhWPhvzwsGFxuUpatcVCG4Q1P4aMTWxXTTCr9MydDaaqbIgL8Lx+A6X0 DuctJn05+baDuMMCADmadCh73Q/ugpThNQQT1vvtMP4UPrkQZtlEG8QiezIvYnuhxCRg gtl+I/72UTKnNsXQyee7ltZex6O6FD1Y1YSwmMo9tMN4YJtE3bPSRFgl31oHdEgmimQv B33g== X-Gm-Message-State: AOAM532FefARFEflRIcCjpW/9R96deIdbB6nkJ+L885fjsKau7xjcZem cdiZ+tIK221ZOICHlkQEsc0zP6DJ4A57b8urii8RSA== X-Received: by 2002:a25:e68b:0:b0:63d:942e:17a3 with SMTP id d133-20020a25e68b000000b0063d942e17a3mr12898845ybh.563.1649378707402; Thu, 07 Apr 2022 17:45:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Saravana Kannan Date: Thu, 7 Apr 2022 17:44:31 -0700 Message-ID: Subject: Re: [PATCH v2] printk: ringbuffer: Improve prb_next_seq() performance To: pmladek@suse.com Cc: Chunlei.wang@mediatek.com, john.ogness@linutronix.de, linux-arm-kernel , LKML , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , Steven Rostedt , senozhatsky@chromium.org, Android Kernel Team Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 Messed up mail headers. I'll resend this with proper mail headers. -Saravana On Thu, Apr 7, 2022 at 5:36 PM Saravana Kannan wrote: > > > --- a/kernel/printk/printk_ringbuffer.h > > +++ b/kernel/printk/printk_ringbuffer.h > > @@ -75,6 +75,7 @@ struct prb_desc_ring { > > struct printk_info *infos; > > atomic_long_t head_id; > > atomic_long_t tail_id; > > + atomic_long_t last_finalized_id; > > I really know nothing about this code, but while looking around > kernel/printk/ I noticed kernel/printk/printk.c has these lines in > log_buf_vmcoreinfo_setup(). > > VMCOREINFO_STRUCT_SIZE(prb_desc_ring); > VMCOREINFO_OFFSET(prb_desc_ring, count_bits); > VMCOREINFO_OFFSET(prb_desc_ring, descs); > VMCOREINFO_OFFSET(prb_desc_ring, infos); > VMCOREINFO_OFFSET(prb_desc_ring, head_id); > VMCOREINFO_OFFSET(prb_desc_ring, tail_id); > > Would this header file change also require a change to that location? > Something like > > VMCOREINFO_OFFSET(prb_desc_ring, head_id); > VMCOREINFO_OFFSET(prb_desc_ring, tail_id); > + VMCOREINFO_OFFSET(prb_desc_ring, last_finalized_id); > > -Saravana > > > }; > > > > /* > > @@ -258,6 +259,7 @@ static struct printk_ringbuffer name = { \ > > .infos = &_##name##_infos[0], \ > > .head_id = ATOMIC_INIT(DESC0_ID(descbits)), \ > > .tail_id = ATOMIC_INIT(DESC0_ID(descbits)), \ > > + .last_finalized_id = ATOMIC_INIT(DESC0_ID(descbits)), \ > > }, \ > > .text_data_ring = { \ > > .size_bits = (avgtextbits) + (descbits), \