Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3332823lqp; Tue, 26 Mar 2024 06:35:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVs+HWUSfOMvrQQIZJVdYO8p0ywlZqf7klVeQ1Z1anTBv+Q62eme/73T1wNNjvMeRxDX8g5ELC+Afeaqhp8WBcBQV5U7pwj13/u5n1Org== X-Google-Smtp-Source: AGHT+IFCcr96R+2sSqqmDNFp/BgKFCnk8d1bo2pQ8kEH8vZFuusfzwgpkVMNEcZPxdmKJgIR8wLM X-Received: by 2002:a17:90a:ba84:b0:29b:6e9d:5897 with SMTP id t4-20020a17090aba8400b0029b6e9d5897mr9740851pjr.23.1711460139395; Tue, 26 Mar 2024 06:35:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711460139; cv=pass; d=google.com; s=arc-20160816; b=PV7TKRHV7kfW2fqVIxdnwr+codDINhmvH5y+MrkAgYHvrTfc9mpTLVzeItxa59Zwqi S+O85yny8s31SFKXFDieYCBYcYHhTVeawgK5l2vMV1MbueOEj7s3iq8u7xhr8i/SrfB7 zE4upo10JK+m1Ri59RWLlYT2kRWR7y4KqNqbM0PqpONln3SAFC06slK4+Zao3TXalCzA DvsQXWQSpy73dqgIVtTpdNFeZWvcMS/nFGxhKb5mhuq95AigQ3RPT5xyFymDmZuhKE3y Gk1PCJ7nCLtwhzTIBVYLh/1HVELDhpnLrC4vCUyrsNa0dVyoe3cEE8bzYbXwMF0Zwxb6 /4og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=HkxXRF/aPdhL4L2cV7/gEtwsEUt/jGctHq5T5exwZMc=; fh=y3weNqDnZb4uBA3Otlz9roya823+P6aIxjdf0oDWjv4=; b=ESY87AkRu8VCnU859ebPH+xwoV8acCwlJyw1eeL6P5ZbrBaj3BuUGX/uJZYOHMw0lm mgJwYqU6Cs+Lk4hB2dVQUiKlXhfl8UlFb9QnlKl3NRooxI03voxSD6ETxBFDMrLX2tdi 0Jt6KKHCEYdxfogW/cbmpsT5koA6wULLv6rtWKZNVfSrMptdgyzNCB0eraPCC1thTsg+ kmYpYJO9F5+0ALbZX2XuHYDUNIaTGM01z0PvivnbGSnBkzaj2RyIFY1zBZ9xwJ3F8Zxr dsF5BVc+Y5zKZxuuqcxIyfaw9szh6dXHdhEfKGZzgRq1y671RjZy+rj9E22H5qIz8QoU Xp6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="eiAUb/a2"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-119064-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119064-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id nn11-20020a17090b38cb00b0029be9d81edfsi10010084pjb.176.2024.03.26.06.35.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 06:35:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119064-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="eiAUb/a2"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-119064-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119064-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E1CFF2E2240 for ; Tue, 26 Mar 2024 13:35:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84C4E74BF7; Tue, 26 Mar 2024 13:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eiAUb/a2" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 387704F890 for ; Tue, 26 Mar 2024 13:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711460132; cv=none; b=blxHR8aQQxrzmhr0KWaiUwP1/q6ByBQ2Bak+NpI9moXX6T0GuP03HDQ9ubn6X6K2WHYqZhnFRfowie2illc/6rsDbOpUgZaoumR/ymaBujxVUwabdz8NNs6cPe2uoWr0NPzOYo1F9NUhni8lNZhesGOJ09mtVseikDFbjBnXY/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711460132; c=relaxed/simple; bh=rj9wNslWKACImubsN/JQmDHu+gQx8aSv4Y1IPRRrmlM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=iMEZ+iiDwEDsE9DRefYUss98gm/rDSwaBz5fFibl6ayVL5IC/o7bajExVQnKD6nsSE0AYnK54r7JV6aLp8CkE9GPrMishpJCJ+pNOlYiJWc9mVtWvV4+sXK9eYkQ+pCknV7sSEjTXYajQQdSAA6WiJef0fA0L0KlV/8cHyIxCio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eiAUb/a2; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56c2b4850d2so765000a12.2 for ; Tue, 26 Mar 2024 06:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711460129; x=1712064929; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HkxXRF/aPdhL4L2cV7/gEtwsEUt/jGctHq5T5exwZMc=; b=eiAUb/a2EfSmCe17+lhYq5tIXccdS6ErRxv76cdhHfsy8liVjarp3M5FU30UgFOCdc YLqjfIWF1PEXOT93Srl73QfxJlhTcCDgRG0vxmbRJDSH0wKAmgw89DswSSOVW2soRrK7 ZS5JW+Qmz54Q33v5uTXGI+eq7p9+QHhBr9cvz/g+Z0V7hEWNrL3CTuKU2e+k0K23gaum 3EXZjyJ/MInaZ6OufwVlrmgfCsTfhFzmQzYljlRQ3in7CiXRLShID9OfYC/V2yVXZ2Jh db8B4iN2q92bxmU1XvWvy2LSgsnuQ2bDW1fdotvwrA+1YDpGyORpDQS34ADiGLchDhLo oHSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711460129; x=1712064929; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HkxXRF/aPdhL4L2cV7/gEtwsEUt/jGctHq5T5exwZMc=; b=McU6pSydTMT41CoKbhEiMm5ZiiZtjsmWamErBcXNt1GsA8m0Ggk4XooxNOa92xVMNv CZUdiYjUZa6eMW7TIUdIGLtg9/aol+HyRQowDEe7aRsDvwZpV9aIfwI784J2jmfoy+mk CiUbQYG9Ej9Bl+RwKf6541tFgR+4zcHUyKJKqur1pTIkofYJb1EB3Y1aw5DCRRU//PQX LJJuGe7UYsoD/9qSRv9qBpnfNbFulrWI4VXJFHnBAvybhbEb9y/hUlJ6k6MVW08U8ywa XkzwZzEMP6RGwnUNvxYjX+AFwBAX4evrSlSCFF0VqRsJx/J6XVNOZBL968V0GZnba05S y4jw== X-Gm-Message-State: AOJu0YxcxW5qHKDRNq28WLUxDGjESDXtzzsEIk2nwLbkJU/R31Oi7IX8 mkhHmHWTqSMbZi1v33yxpcjPQBESIObi0IAuzN0KvQLJGcyZ+ZgLHVd/hJKp67GKMBH4dWHyFcO OSj9pQ18kSnFJXSAUx63y3Dplduc= X-Received: by 2002:a17:907:868d:b0:a47:5351:e8a8 with SMTP id qa13-20020a170907868d00b00a475351e8a8mr2629227ejc.33.1711460129234; Tue, 26 Mar 2024 06:35:29 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240325035102.15245-1-adrianhuang0701@gmail.com> <874jcueydh.ffs@tglx> In-Reply-To: <874jcueydh.ffs@tglx> From: Huang Adrian Date: Tue, 26 Mar 2024 21:35:17 +0800 Message-ID: Subject: Re: [PATCH 1/1] genirq/proc: Try to jump over the unallocated irq hole whenever possible To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Jiwei Sun , Adrian Huang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 26, 2024 at 6:32=E2=80=AFAM Thomas Gleixner wrote: > > Why are you not handling it at the place where the seq_file position is > iterated instead of doing this + 1 - 1 game here and getting the next > number only when you already ran into the hole? Thanks for the comments. Yes, I did think about the changes in int_seq_next(). The reason I made the changes in show_interrupts() is to minimize the traversal times of the 'sparse_irqs' maple tree since irq_to_desc() is invoked in show_interrupts(). Does the following patch meet your expectations? If yes, I'll submit it for review. Thanks. --- diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c index cb0edc7cb..ac051a9b8 100644 --- a/fs/proc/interrupts.c +++ b/fs/proc/interrupts.c @@ -19,6 +19,10 @@ static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) (*pos)++; if (*pos > nr_irqs) return NULL; + + if (!irq_to_desc(*pos)) + *pos =3D irq_get_next_irq(*pos); + return pos; }