Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp396515pxb; Fri, 16 Apr 2021 08:16:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaqm4V2u4CuNkaD2owdY/BVRNnd/aTV/qMHf+/a2jkLXC1ijgGQsvdLSSST4rnYgZ52MyA X-Received: by 2002:a50:eb45:: with SMTP id z5mr10639663edp.243.1618586162809; Fri, 16 Apr 2021 08:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618586162; cv=none; d=google.com; s=arc-20160816; b=JAoux9PnIUrhXr2ER96POhCNN0cYONIWionnXnI1tvCAEmyurpSrNyl/bcsjIiLTEl Y1CM5wEfIVIglArK6/HdNvr4mBvYbsU7KU4xMUlQ2QPwq/3oWbqiYXOwPnnO3S6Jgj6C BIyWDtwW3/6unMfIMOurCt2zqKqfiKpVNazzETv1Sevezz3Nsfr4Y/u4hMPnubEkDelT P1Hpwvc0O3nn73nyLTAKkPyL8MJnGnm+kGGfV+VF0/JPcHUtI0RHF5Bl/Nbjlv4TxdJw awI4q4XI/+SCNegM60w76LNX+6ZzZGbBBnhl+zN1AdAROpid1u5TuKH/5J+CmNyC/UlA yzBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=keIT10QQjocHKJyfD7YBeoaigDEvtt9IBYvkNbGcasQ=; b=Feh7rQR+LUpB9bpuQ3H9Q8w2rguxzrqFwnCQAjw2OKKg72Y2JqOT3OvH0Y0regYBiA N/75cc8G+7ikuiUQ2A1pOlhgql8yirLSwwPNK3x7q0ZefuPx8lJ/JvLsvIYbiLrWkhrf nLkqGVQbuaAZnhxToXjSqVaFry7LjfVMlBIyP9iCHJsuch3pR4ZUy06vwGel4FIv3q9Q PiJcphCijePJeqtPA7u4MuDScZEnJldwL2M+MTUympkEDKnjG0VZKQWjGNyVbRTL8Av4 zlU8WdUQ9sTEvYzP0KLSbhriedzWfq63vItziQWyH2XlyburAhdTJuCTaO7mnKjggpOi 50Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=fkGizxZ7; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz6si5073607edb.335.2021.04.16.08.15.38; Fri, 16 Apr 2021 08:16:02 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=fkGizxZ7; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245408AbhDPPNY (ORCPT + 99 others); Fri, 16 Apr 2021 11:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236098AbhDPPLp (ORCPT ); Fri, 16 Apr 2021 11:11:45 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C0FAC061574 for ; Fri, 16 Apr 2021 08:11:06 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id 18so12289196qkl.3 for ; Fri, 16 Apr 2021 08:11:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=keIT10QQjocHKJyfD7YBeoaigDEvtt9IBYvkNbGcasQ=; b=fkGizxZ7b1PnawFuMt06pOmAE9k86OvXob09tNCZ/M6Ulu7aDG8a5jrH0qNW4CBYm4 m/hz31GQihFGT3bcqwrixJXNYXPxLlWGOBvd1Ld7Zfuy0NZewTjIe9nhIEWdqK5p/goa t2MfuOyXOL+/wYCVedhhnNTg+PPjLKE4+r4yb9cxPxyuBRSkd3sezjU5S23ZJATbx7Kf 6z0rYZaRaIIra0WL/LeG8TawDViJ43hQTFBD5LpzG9e6khD/0m/jS7d/jqcc2BgdnC4p kAt9YD+wbRWo/nhd8Giwk32TKcRtJApRGu6rGm/WDEpWzbB+k/MJAixSQqV/Vrw/peXF UEJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=keIT10QQjocHKJyfD7YBeoaigDEvtt9IBYvkNbGcasQ=; b=NUkky00p/ll+k7o7/hj3vf4zXHxtNgWpSdkceL9blolUxhmXYdRL8wJgnAoyWd5B4n D9P97TnR4daM6VhMRcjZatK1xT0jC++Rb2uSluVC1e3LNTMr0DpU17ID1H4oPUwpMYOj upB+goC0/V9q0Pnm/3SiQtFHxrSgXwwWWwfEMpq/h5reOsXSEAYgcjgUyeV+7m9vKkkD T+vbADxGYy5E60b5EUlqaA5DMAgBbLhC1x4NeywoB6L4K6GsPNDJI2iEdDRI8BELjLja EnahCTo2efT/SDVItkn4JFI08bxkmBdiNERjdAHUh1+wqTeioY1w8kQ/oifm2yl1GlD3 uQIQ== X-Gm-Message-State: AOAM530BnxekFIZbimLHfa/O04mQm/ZXHK/F0o14/SbCGHjP2S0U8uqd uGoq7UXvvAyROvDwJMVXVcajJg== X-Received: by 2002:a37:2f41:: with SMTP id v62mr9404743qkh.408.1618585865760; Fri, 16 Apr 2021 08:11:05 -0700 (PDT) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id 188sm4539399qkf.27.2021.04.16.08.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 08:11:05 -0700 (PDT) Date: Fri, 16 Apr 2021 11:11:04 -0400 From: Johannes Weiner To: Charan Teja Reddy Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] sched,psi: fix the 'int' underflow for psi Message-ID: References: <1618585336-37219-1-git-send-email-charante@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1618585336-37219-1-git-send-email-charante@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 08:32:16PM +0530, Charan Teja Reddy wrote: > psi_group_cpu->tasks, represented by the unsigned int, stores the number > of tasks that could be stalled on a psi resource(io/mem/cpu). > Decrementing these counters at zero leads to wrapping which further > leads to the psi_group_cpu->state_mask is being set with the respective > pressure state. This could result into the unnecessary time sampling for > the pressure state thus cause the spurious psi events. This can further > lead to wrong actions being taken at the user land based on these psi > events. > Though psi_bug is set under these conditions but that just for debug > purpose. Fix it by decrementing the ->tasks count only when it is > non-zero. > > Signed-off-by: Charan Teja Reddy The subject should be psi: handle potential task count underflow bugs more gracefully since it's not fixing a known bug at this point. Otherwise, Acked-by: Johannes Weiner