From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D026FC433F5 for ; Tue, 11 Oct 2022 18:04:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 086776B0071; Tue, 11 Oct 2022 14:04:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00E9E6B0073; Tue, 11 Oct 2022 14:04:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCBB46B0074; Tue, 11 Oct 2022 14:04:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BFFAE6B0071 for ; Tue, 11 Oct 2022 14:04:45 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7B75C140F88 for ; Tue, 11 Oct 2022 18:04:45 +0000 (UTC) X-FDA: 80009444130.08.8887623 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by imf08.hostedemail.com (Postfix) with ESMTP id 05F6A160023 for ; Tue, 11 Oct 2022 18:04:44 +0000 (UTC) Received: by mail-ej1-f49.google.com with SMTP id sc25so27035514ejc.12 for ; Tue, 11 Oct 2022 11:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ETa5U6KaROJwkg59mQUai3oA9ltBPunhs0v0qUZxk8I=; b=dqGJODTRAdmT8j3Vpo4S9bC4XSgILD+3IpfmMRQNm1gJjsS6OqjV8MnUkRP+qcnx3n Pr75Ta5VAVHZffbnZHS4aK1lCnkw/XahdQt30Ac7t8AoU2NaH/hOE6V2+h+hWRRGvveR 6G/vqe0ouAkngeA2cSM4afQyWtgSJv/mLMbTHviJDU6SNlsSXRoT/4N1vFnd4fZR+gJv /n7vg8IjOu6kTZBMBI3cQBIAcGBDTVHcCuli+BKYnlZnZFDedHLVBrKCD04J1ZEqhYYu chqun1uQJHve0E9qiHhYEfSSGzKNGAfccmwwyd+AUpz13TPBBwALt42K2giSsDWEyvyp OjtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ETa5U6KaROJwkg59mQUai3oA9ltBPunhs0v0qUZxk8I=; b=uBfeHIjRnQG5iwTXEJokWUhiNczy2j4CbBVULszgXMnGSJgJ4VHmPpykiuLoKr63Hj nmKRfN6FFq5wKMx1JSd8K48npt5sW0hbjVPqYhr/B/Z9WDFJaJK0xltRQh4rKdSuSYKQ 1PgrGkXjIckeLCXpQtFRoenddR3dSSoPZsT43QS5mCMsWDctU8Rtp8SBWIY8YIfEBVrH I0w7ElSg7hMu0j78YyzTOWyQwK9+MPjYxsynSmjMtg7V+fQPRJvAkxJGVc/vTa+bX38M shHUuicnjhjicdBtu5BEAeK0kV5W71GpJoZ2/oiZ04Sownl/9qmsc481GME0h65ad0IO M4Gg== X-Gm-Message-State: ACrzQf1CvTCDUF/hdLgl3iC+SrP3EnFXADK4Mszm8ix/j9TIddiT738V 0bJMm2YUA3sagnChaqQQ6+6s/QNGQ1MUfQ== X-Google-Smtp-Source: AMsMyM7UrKWs6iLL7RoQLqvH3qbD5dRbe4B9w+o648Kf3nU4zEo5wnYTzuW6AUC1beHNqj7NCpk+Pw== X-Received: by 2002:a17:906:8461:b0:78d:dd76:5695 with SMTP id hx1-20020a170906846100b0078ddd765695mr3314638ejc.583.1665511483750; Tue, 11 Oct 2022 11:04:43 -0700 (PDT) Received: from localhost (cst2-173-61.cust.vodafone.cz. [31.30.173.61]) by smtp.gmail.com with ESMTPSA id la6-20020a170907780600b007030c97ae62sm28932ejc.191.2022.10.11.11.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 11:04:43 -0700 (PDT) Date: Tue, 11 Oct 2022 20:04:42 +0200 From: Andrew Jones To: Yury Norov Cc: Linus Torvalds , lkp@lists.01.org, lkp@intel.com, Linux Memory Management List , linux-kernel@vger.kernel.org Subject: Re: [oliver.sang@intel.com: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address] Message-ID: <20221011180442.cwjtcvjioias3qt6@kamzik> References: <20221011170949.upxk3tcfcwnkytwm@kamzik> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665511485; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ETa5U6KaROJwkg59mQUai3oA9ltBPunhs0v0qUZxk8I=; b=feTQEoY5bpSIkY0qNPbvZW1LQvTWuFEvs9ihOsVa3g13DnRuuXHfsw1i7i3z7Fo5KouBOZ ciki646tVDlQIrRiq9c1k9GP67zR6rHFdg4YmOuyXswTT/hdjEVCLa8jBRX+JY+VNguTIx 4FgipBdkZKXVeBxPyCR72nZnhNLMnew= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=ventanamicro.com header.s=google header.b=dqGJODTR; spf=pass (imf08.hostedemail.com: domain of ajones@ventanamicro.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=ajones@ventanamicro.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665511485; a=rsa-sha256; cv=none; b=lPW7WVfnrdoxCrYU8ZBYkXLMT7+rYCpS5B4CrhYHdFP+1yg4104cDwJ2ntbA+CLwgA3ffE 0NMhHDFm/Fs7WB56mSq0BiUpUoKfesBdEIeb2JFpreulCnFqOOqVRueMcpNhmdkQDwLvLI hRF7iiA8J/LyZ3ZORlSj/XCo52hEmHI= X-Rspam-User: X-Rspamd-Server: rspam11 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=ventanamicro.com header.s=google header.b=dqGJODTR; spf=pass (imf08.hostedemail.com: domain of ajones@ventanamicro.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=ajones@ventanamicro.com; dmarc=none X-Stat-Signature: syywsm9cpswxwsndnkttkbgdabyijwth X-Rspamd-Queue-Id: 05F6A160023 X-HE-Tag: 1665511484-968014 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Oct 11, 2022 at 10:23:27AM -0700, Yury Norov wrote: > On Tue, Oct 11, 2022 at 10:16:03AM -0700, Yury Norov wrote: > > > Hi Yury, > > > > > > I just wanted to report that the warning fires when doing > > > 'cat /proc/cpuinfo' on at least x86 and riscv. I don't think > > > those are false positives. I'm guessing a patch should be > > > something like the following diff. If you haven't already > > > addressed this and I'm not off in left field, then I guess > > > we should integrate it into your series. > > > > > > Thanks, > > > drew > > > > Hi Andrew, > > > > Can you please send it as a patch with a description? > > Also, can you describe why we'd silence the warning this way? > If the cpu number greater than nr_cpu_ids comes from upper layer, > we quite probably should investigate what happens there... Darn, I fired off the patches before reading this. I didn't try to completely digest seq_read_iter(), but on a quick look I think the reason is that it implements something like p = start(); while (1) { p = next(); if (!p) break; show(); } stop(); where cpuinfo's operators are start() { *pos = cpumask_next(*pos - 1, cpu_online_mask); if (*pos < nr_cpu_ids) return ...; return NULL; } next() { (*pos)++; return start(..., pos); } So the justification for the patches the way I've written them is that I think we just need to return NULL from start / next when we've gone too far, before we first warn and then return NULL. Thanks, drew