Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1098611pxf; Thu, 8 Apr 2021 23:11:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygedQmUZGFcoxwCnxTo+UjESokONTpbAGWXTrOD0M1BfiKUMJJ6z2hektG2x4orGjGltKV X-Received: by 2002:aa7:8889:0:b029:241:e8d6:a2e3 with SMTP id z9-20020aa788890000b0290241e8d6a2e3mr10712360pfe.55.1617948664344; Thu, 08 Apr 2021 23:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617948664; cv=none; d=google.com; s=arc-20160816; b=EtsFEhzLjyp2R44Wp1GVu52RotFAssLu6t5Z1bbRQgq2d99nF1Nw91OjdYLA8kBjx9 yeQUZTNTXH48WHrL9DZ5HaD6PVzXtSJ2LeQKuA02eXEr9cjjrRCRt2vjSylnsXLzpHCM 5n8OsC+KABW9yp9A3xpiNKZVqpRalfzXEF8xtFHBxlqRjuK8e1HdNJcTwogr4HHG0ufg dU4FMOakydH/JqVmLP4jw/3COGbctljid374nxvmyXdoKBRYaS148raVciYSgzKc2VR7 PqM5T14RY/BPIPAuPEvX7VORMZu6maQkeqdwfeJBk4Vk9+PDn+mnB9LvruGWo5zzUHum MD7w== 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=fBNMkqQtmjFLEExzv0JFBEEJ+ZaPUJpAtqd4KfHFgv0=; b=EwQDWhBnnkukircL832CDKPMwcxYBHxLD6l2P449pwQp1J1Oa40hmyIQF95QCzmLNp w/mt7KbYs3PLo44YmNgprJXpeqQm//Z27Q8zSSt9VJi888lrWSUuWxBaHhhau1jVKuLK eojAefs2BgpO2uJ2KhvFY5D72lMA5KYA0JMIo6/4ICvjonoRZNOgyrVv/qhS+0jqlfAa ynarC/YBbq/+L6kmHTxQy0ewZl73PZLKzuO0s0v+KcMUgezqyotVwYAljRLZkvfhgvtP vK3HK7O8JcR0HIO1a4c1xw2VyQF+DADg/Mo8m4ukuYX76GyaUpXPvv7DG8tw+1MZbcsR zqrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rO5ecE1g; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si1885991pfm.278.2021.04.08.23.10.51; Thu, 08 Apr 2021 23:11:04 -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=@linuxfoundation.org header.s=korg header.b=rO5ecE1g; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbhDIGJP (ORCPT + 99 others); Fri, 9 Apr 2021 02:09:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:59866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbhDIGJP (ORCPT ); Fri, 9 Apr 2021 02:09:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B8C76113A; Fri, 9 Apr 2021 06:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617948541; bh=n/aP/TcQ/267gm09eQYkvPethiroHue0xczvg+6G3Zc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rO5ecE1g04K9xDFy5L/LGdHimUdczHwrglWJODNv17qHP7X9suZDf3/uKV1/+gmW5 xib9EmFsKorhPLw3Sxml7u2t5pHz1l2o8bciR3b+iFXHW6BQV6vH3IchB9a0RUj1UA azcAJI5rVqaIouGFZhqEJaWqWg2G26Yx4rBR1LYo= Date: Fri, 9 Apr 2021 08:08:58 +0200 From: Greg KH To: Hang Lu Cc: tkjos@google.com, tkjos@android.com, maco@android.com, arve@android.com, joel@joelfernandes.org, christian@brauner.io, hridya@google.com, surenb@google.com, rdunlap@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] binder: tell userspace to dump current backtrace when detected oneway spamming Message-ID: References: <1617939657-14044-1-git-send-email-hangl@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617939657-14044-1-git-send-email-hangl@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 09, 2021 at 11:40:57AM +0800, Hang Lu wrote: > When async binder buffer got exhausted, some normal oneway transactions > will also be discarded and may cause system or application failures. By > that time, the binder debug information we dump may not be relevant to > the root cause. And this issue is difficult to debug if without the > backtrace of the thread sending spam. > > This change will send BR_ONEWAY_SPAM_SUSPECT to userspace when oneway > spamming is detected, request to dump current backtrace. Oneway spamming > will be reported only once when exceeding the threshold (target process > dips below 80% of its oneway space, and current process is responsible for > either more than 50 transactions, or more than 50% of the oneway space). > And the detection will restart when the async buffer has returned to a > healthy state. > > Signed-off-by: Hang Lu > --- > v4: add missing BR_FROZEN_REPLY in binder_return_strings and change the size of binder_stats.br array Should the BR_FROZEN_REPLY string be a separate patch as it's a fix for the "binder frozen feature", not this new feature, right? Or does this patch require that change and the frozen patch did not? thanks, greg k-h