Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5820123ybc; Wed, 27 Nov 2019 09:56:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxBQoBOm0F0gPa9DspbE4Zq79JirT/fj2Lwyc5Pr9k6D+vc9SbiTwkWqjBaV2NMGH8ptI+Z X-Received: by 2002:aa7:d60e:: with SMTP id c14mr33514673edr.174.1574877382997; Wed, 27 Nov 2019 09:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574877382; cv=none; d=google.com; s=arc-20160816; b=UUeLx75WY0pirAsAog4qxahVmJh2vuilP6KBFTWHXTQMCLhj45cTLN3zUACvC0MAVK 47JtYMhEZXhxDJH89JrTEqFR2Mg8p0esEIf160587CM7n5K/75oyb9Y1raH5T4NuOlMp Wx56NIHpN578OTfM9CHfv1tMzSTiOokEv+8/Cn70Bb8mQsNB8GWltaaTL7EeciHTzAUA vBKPWcb0n4L1EmPy2taE8iHUUkccJkRhJbdCGJ1JyO2UnRv50wB32H9dFjqCSgMgRSbF mnxSOMTf18Tcdq2chVhd127iuURvYjv0hUQ4SbKIa7iK6uIgIw6SgUv3xSQyHAGckmni SrcA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=fTmVS+hVHtiQTgwNuCFFA0kECrnZjg8eJI72GeuE00k=; b=0+bz4E2+b58K2A1bQqHlq6ebNUlbVQbrmdxU9LWo76O2eR32/YDGTWZd35NyjC8LKr UPUTrkZQp1plDuodMT+IUnEIS56tbagwuV0C2ufy/UeFzQ9qtqlUpg7Cn/scpLmjyRUv t/6LYD22m3JrC6V5O1r0CzkFWd+4LOI7LnAuZ0zhEcf/vhH93cW6STncSiHFefFFUvJi pjq9mQ4suLiQh3awHpTLw5s1+RRGngoBv8G23oey6NqkTiFa2GMDK/fDHyJt637hnvFd UgCxp4QELDCsnBsA6SocAbcS3nMktNJg4C8GiuYTLjI5euJ19OPQI4/ImRZHDcbAWlRJ b7KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FdebbbOl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id s24si12297279edy.18.2019.11.27.09.55.59; Wed, 27 Nov 2019 09:56:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FdebbbOl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727415AbfK0RwE (ORCPT + 99 others); Wed, 27 Nov 2019 12:52:04 -0500 Received: from mail-il1-f195.google.com ([209.85.166.195]:40751 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbfK0RwD (ORCPT ); Wed, 27 Nov 2019 12:52:03 -0500 Received: by mail-il1-f195.google.com with SMTP id v17so17905178ilg.7 for ; Wed, 27 Nov 2019 09:52:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fTmVS+hVHtiQTgwNuCFFA0kECrnZjg8eJI72GeuE00k=; b=FdebbbOlSL2DOl3FifLKPzujFS4QHXzJ4zeznPAEBlJo07rNlj+rF7jCmX5qUjq3FQ kyApSB/9P57W+WXslS63SW6QZ9zx5PX65mcEEk6KkYc+nDy3/6RXUOoqY4zN1WiHZ1Js RJ/B6UY2EMLhp0ODhG3YeWbsVU55VufytVa400VMUNk6OvjlgydVpwYymO6F/Wu2zS6L Fp60/jIHzJIvGjUK1/PJ1MsrFtNxNJ24lGPoapjY1ockKm0FdA0oD3Oiezyz3e2mmB38 3JLw1foe963Hdgphbv/W41Yn+EDK9QBRWc0Fz6E/oav8e2Afas8EGpEeZAKMY8gSMGsa F42Q== 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:mime-version :content-transfer-encoding; bh=fTmVS+hVHtiQTgwNuCFFA0kECrnZjg8eJI72GeuE00k=; b=b3U1QsrEsaXI+RvnSEH5Yc73gWUo+UhMlPMS42k7aciiK4mb4Id9YiEEsLGTebkaHW ZLvgkarykwcPNd0RyBXrAEGPNy+r4pn5smdjgnPKDnv05x0ybMlADF96o0p+8hoR3ONr yrZZOwrd8glwdfDoGY4g4Fzv6aKZ64HzG2jWqZ9QO9NqLXLn7fOO9Jau3IBwRhpF8ICH MrNXsB8ZvmK3LpRT/oaZoCSqzR/Z/LW7selsphLXeWwIB5PyeEW92uZdBlCyvGHQFwv6 6eJ//JBToFFppHBiiOM7RL2gTC4z14jXPhl7qfF82RXjtkdAIAjCUSeN0XHeI0CMpgPu 2QKg== X-Gm-Message-State: APjAAAXOB4WCQLle/HhFKgulZfXKJOXNzt/hWGQOn3/4Ro8iX05VNVse oHQSs9qFtqDrDZknIq7lKLE485gneDo= X-Received: by 2002:a92:d581:: with SMTP id a1mr6723777iln.39.1574877122746; Wed, 27 Nov 2019 09:52:02 -0800 (PST) Received: from localhost.localdomain (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id x62sm4568236ill.86.2019.11.27.09.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 09:52:02 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, linux-kernel@vger.kernel.org Cc: linux@rasmusvillemoes.dk, greg@kroah.com, Jim Cromie Subject: [PATCH 16/16] dyndbg: make ddebug_tables list LIFO for add/remove_module Date: Wed, 27 Nov 2019 10:51:55 -0700 Message-Id: <20191127175155.1352058-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.23.0 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, 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. Signed-off-by: Jim Cromie --- 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 82daf95b8f64..99284e775682 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -960,7 +960,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); vpr_info("%u debug prints in module %s\n", n, dt->mod_name); -- 2.23.0