Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp180463pxh; Thu, 7 Apr 2022 18:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7c2zm8N6+jYUR630Skf2mjWklaBlIXcf3kp0UscEg9Uc8FIR+DybbpoommA/kRhNnCKmC X-Received: by 2002:a05:6a00:f93:b0:4fa:dab4:6e2a with SMTP id ct19-20020a056a000f9300b004fadab46e2amr17217519pfb.15.1649379935306; Thu, 07 Apr 2022 18:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649379935; cv=none; d=google.com; s=arc-20160816; b=d946KoPSbXlSwUd7+lIUaZBJSr/YIS8HEd4xc0BFUMkPgd/GBlUhxDDxItlh9Kk3Df T55HX8SwC5CUMpl0diuZVkmy7S3vITK9Ly3pptgYL6wjBhCswJdWM6F3Q1yF0JIkdGs8 Wd+14LEaU/gjs07/Ae8x6tyKak1fqakye+OFbqM+f/UxUfrMm0vou7uf+UVw0nbYoF9M bdApgbz1wmvn/ZyjbFn6Wjf8g2+Pk3WRWTnoD0tDyGKRs13Ch51Y4bAWQOtQvB4RTs/Q QzFX/bwmPk8viPp22r9QXEk4DmS4nIlr0CbId1enVQxUC+yypTrTwNoyz10IFHORObfI DgKw== 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:mime-version :dkim-signature; bh=1HcF8x3UIKiVVn/nUxJJBAAmWRasyyi8SHqMPG/VXOo=; b=TsiC/NwFA8mJ71qDsSKaoBNl5HV4N9S5hxaIGGJch+7IJQbYD9DUZ86TQ/p3tWj7KY qKU8yU04wLTvQsbXlbKNBkea4VG5ZHJlOq+2LDpebhCt1+T8vvGjIXTZMxQyfiWDpYCE I9Ch4/xD8t19WjVvnpwID4oFS65XHHvmd7vZ3gNLYrcpdh+biwc0kghX+j6R6UgxoseI 7bfjdyBiymvZ9H0KEevT1SOwVDnCH7jNUKEMn6nPsr5ARN8b9XKi021FMBrI6pV184HP 250W/urbx5/uXc3TNCRgq0vATHD+TyVPPZiF0pC1/yuUpvh4jiynbTM/LAAwbjFM3v9K Kb/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oaMxNPsn; 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 u11-20020a17090282cb00b00153b2d164efsi1142375plz.247.2022.04.07.18.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 18:05:35 -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=oaMxNPsn; 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 87E6710818B; Thu, 7 Apr 2022 17:37:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232174AbiDHAi4 (ORCPT + 99 others); Thu, 7 Apr 2022 20:38:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232896AbiDHAiy (ORCPT ); Thu, 7 Apr 2022 20:38:54 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F384310660A for ; Thu, 7 Apr 2022 17:36:52 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id x21so12455162ybd.6 for ; Thu, 07 Apr 2022 17:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=1HcF8x3UIKiVVn/nUxJJBAAmWRasyyi8SHqMPG/VXOo=; b=oaMxNPsncnAcpTqjMOuO0KwQi4OT0SDBn7pfXGEpdMPaPrLYwKpBZBUYODAZSozbUB sxIKaUFbuU33BA2dzhhpejRMykt1RzGUGClcE2msSrrs2Jki6k7MAWCstFYW9FRlFpSv 1Gq2pVdVXJ4AymSvGzwloiIO/8VW8a1mq9mA78pY6rWIw7DMc2pw6FhKoiGhrOD8k1DN owUWeoI1ArpIpiam8YpGd6rPRmQDd2Z6rM7ta/RnQsNhVcBNNohjucbWEzl3+vxsBsP6 qpVwRmC1W97xbVHWYTEVYQceRg0jt0Y9/gqetveqpSbGOyckPoUOcQ/gS0TFX1dGhx01 colQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=1HcF8x3UIKiVVn/nUxJJBAAmWRasyyi8SHqMPG/VXOo=; b=uRXBu7FYjJZDLMNtqk9k+BCMV0EDFIL+ZIlIAgu7V/+i8OUuoTS0f6g4wG34Lh+kBX 8VzEhuQI1L1dqfpOO4f8kXqONOJN6GF/3sl24LQOcr0bqsOvnsuNLesPrmhgFXYSdTGi tdvZtd6eq3S3yvpblM0PxIRNVY6rtOpU/Ky3XEwN5K6Rs5O3vHCPc9SN7XhPTeT6wSIy LILfYUxM0Wl2BUrerupKbaDRZQA3499OXvrxINFEGO0Lrzh/7vgn7aXeVYG32+pSyAcp uPFV1twADoXlBso7f7o8fhcKe03k7oxRa7T7K0bs5zL7Q7B8jGYYEaOg+s3XEZ8IrfOU RYAg== X-Gm-Message-State: AOAM531hVS+OxCTedbnD8Y7iuifO+sLziSo8aQeL/NR0mV+TqV43TTjr qJ93OMXNCFTOfrXJrYxcQfsiTJz8iaUc3DiYRrC2xQ== X-Received: by 2002:a25:b991:0:b0:610:bf4e:1b33 with SMTP id r17-20020a25b991000000b00610bf4e1b33mr12978643ybg.352.1649378212045; Thu, 07 Apr 2022 17:36:52 -0700 (PDT) MIME-Version: 1.0 From: Saravana Kannan Date: Thu, 7 Apr 2022 17:36:16 -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 > --- 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), \