Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp433835ybt; Sat, 13 Jun 2020 09:02:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFFKvXMvnftcRZ1GrqzQ3h3K59253ie2Hr1hz8GBBmd/knEsb2G7c13uw3sWO4BGEv4Sus X-Received: by 2002:a17:906:fac8:: with SMTP id lu8mr17703187ejb.432.1592064156213; Sat, 13 Jun 2020 09:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592064156; cv=none; d=google.com; s=arc-20160816; b=sB7jW6e26oFiw4Xm57lgRe/wjnEPRx6waRSMjaCNkLHG9Tx5Q7cEJyG1BCWM9nE90r d0Ple94gXxOEXTPnIpLTs1Pwxi6Zd4u6TEQHZDywbHlehWzvgReUiYyi77C99rOnAR46 fQNh3lpWzHo1hRk+WhFN3H8q+Z972MxB1x4QLxN5UgLgdTdlL4hXw7YlqsCCsZJuf8Jg 7zKVIksLRmSxHKntN37JFGFrBBLXeRIOHbCU+JbzMJzM8tjL2n93Z4njsz6V5UEAmE0M SaZGqEA8xgB+uXmYhSaIrinwp/PnQ77ikKFROe7c1NZcTnTFW0vTH992xmnVMiKJvmwj HpSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l5FIpXR5Tp04u3sUycsKL8GMRm8w9TasYjP/WjFsAa4=; b=KZldrKIO25+DrxihBnSsnqaMN5SdiSfI7bVK9HHiohx+L13tiWK/FaFAZEPKl1XXOy NeTUtPdzpFs/DgIcZxEmBz85TkngUFlMl9YhPSodR8jv7lqcK1wxy/bdQdc3QlRjrgQc MpGFWvGt8YUtKGrLDT6NUp8xcHkxseiBo2zStUab5tdAA2/IKKePpTKy13iagnVDHFYg k5jDzsPISeVTcZy+SQrFehKHepGQqtjnkr1t/cIYH1jsgGQh59vhQrfVfNY8gUHTtkqB sr+oeCbRE1Da25O9ddIIQ9dPD73l28WeQ3hb2sfm2J9EtFko8l74k0eNzCTfpeDah5P8 eKJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NaFNontj; 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 rk22si6138053ejb.461.2020.06.13.09.02.14; Sat, 13 Jun 2020 09:02:36 -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=@gmail.com header.s=20161025 header.b=NaFNontj; 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 S1726783AbgFMP7Z (ORCPT + 99 others); Sat, 13 Jun 2020 11:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbgFMP6I (ORCPT ); Sat, 13 Jun 2020 11:58:08 -0400 Received: from mail-oo1-xc44.google.com (mail-oo1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7ADCC08C5C1 for ; Sat, 13 Jun 2020 08:58:08 -0700 (PDT) Received: by mail-oo1-xc44.google.com with SMTP id q188so2536896ooq.4 for ; Sat, 13 Jun 2020 08:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l5FIpXR5Tp04u3sUycsKL8GMRm8w9TasYjP/WjFsAa4=; b=NaFNontjF888fpgzGYek6Fwbe0PJCf2sDH1G4AaHWqeIcfMiRnTsgHh3Mb+/aXTtcB OULHzrhlkZUDjNYKgKeJuBB8j5St6c/+HvGyNUM/swfHOC8KyJXo/HJVp7WEJZcoE5Xw PFMGh2sEHVvVWGJ0MurjX5Cgriz7viqOogHoKyCUmDCfMQnomqnD5ZM/w2ZKWlZRULBW vlkB7oR0ASJpKKDoZChVV25vrzfRL0yRY55pemUcji9xVpbIRR1djALcyYFj8aO9v7i+ a394TwzvnWyq2M9W5GB6zLHRL4uyP+c9q5Cu0Zhhu9KZIUqcY1FXH+rU8CHK8zN4LxNE s41g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l5FIpXR5Tp04u3sUycsKL8GMRm8w9TasYjP/WjFsAa4=; b=Sp3KUKH9BLWDht076hw2vCIBERDetG0OJxS+c5cqJRwoss3NPOj+pvc9QJHzIqhnCm 4xWKbtenNpTr6yU7eSrf8SPOCZTeWdCqcgHxWT4Ccqw+I68iEzV9z7ZXrIl6uLeuH1+S KxFi2HFNR287AyoIE9nfjln/fwn3fRSUZNSK1jFKSDS1z3x/hya8/avdU+/VUVeQrRtg JT7RboF32BAhx4C/tq8OmgThsdaq+/ID5Pf0OsKdFF4S9Ms7xHaJ/QHDthpLzf0grJ2Q tBmT8IQ5+MzxMkZ48oVOBQzjcxHgcXWvhcQONZWTWpdZ+miu6TawNkR/U+pUTiujtDt6 +Taw== X-Gm-Message-State: AOAM533sDvILnCq8gGMNZlMw9t9RXkDptjc4J97DdIjZl5plKIYy7wn3 IitLFWl7JuSeh+LHJCYnPaE= X-Received: by 2002:a4a:8d01:: with SMTP id o1mr14813886ook.61.1592063887760; Sat, 13 Jun 2020 08:58:07 -0700 (PDT) Received: from frodo.hsd1.co.comcast.net ([2601:284:8204:6ba0::aaac]) by smtp.googlemail.com with ESMTPSA id 53sm2105565otv.22.2020.06.13.08.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 08:58:07 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org, akpm@linuxfoundation.org, gregkh@linuxfoundation.org Cc: linux@rasmusvillemoes.dk, Jim Cromie Subject: [PATCH v2 08/24] dyndbg: make ddebug_tables list LIFO for add/remove_module Date: Sat, 13 Jun 2020 09:57:22 -0600 Message-Id: <20200613155738.2249399-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200613155738.2249399-1-jim.cromie@gmail.com> References: <20200613155738.2249399-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org loadable modules are the last in on this list, and are the only modules that could be removed. ddebug_remove_module() searches from head, but ddebug_add_module() uses list_add_tail(). Change it to list_add() for a micro-optimization. --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index aaace13d7536..31d3be30776e 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -896,7 +896,7 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, dt->ddebugs = tab; mutex_lock(&ddebug_lock); - list_add_tail(&dt->link, &ddebug_tables); + list_add(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); v2pr_info("%u debug prints in module %s\n", n, dt->mod_name); -- 2.26.2