Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2047215ima; Mon, 22 Oct 2018 03:22:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV605F07i4iRKxRVrpeWtrWIkOWXytHxeQprEuuAFrD4G9zaFymgzFmgqgW64K/SFYV9NpGjO X-Received: by 2002:a62:55c3:: with SMTP id j186-v6mr36016568pfb.161.1540203734446; Mon, 22 Oct 2018 03:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540203734; cv=none; d=google.com; s=arc-20160816; b=nbpBh3Y0zyZYB45fHtNBXQ9DTb/q5S6euWMRuiDsFw0+e3fv4Bz29ARXv0IqaH2bLu npJSRM6Ql8AigE7VnWjHbKlfdtKXlBYzQB4j1aCEMbDyPp88o+IDuvAjdVbiedA0hB+V T9LOzQmmA7Y8OA9PpPPTieyub6sewv7O9EVJ1M5YxGyeTH2GvyO4IFU8vjkG6aDP1LPv RnewPC3KX0FARWSSz0J2FoNToINebslf7RKk5QsQMQjFxx6xjPoE4JaOSwQQtAkbkvNV 3iC1LXxJ3pVY9QDzGuUvgE7ri6aMOrRarTMZqKdqzzq4GehmDnV8tv0eA37Ulp6XgFMw oGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Njj+9/ijDMcmju79G4bKz3IACKZD8Ou4weaajCJVw9E=; b=fyOvS6F/5t+ZZQnwjofcetPHGeIZLsT3Nc0dNkUHg9aCS0om/Kk7vEi4mA7pdbQfZt IY1aabI7xoiSSoS46jtXbtyi6p3PeZ9JPOtVG0+YjYjKyjtASUawZvAaFNd/vSk6lFbA UwvfeE3MW+WDKX2ANy5kmNbU0bud98vVyEfbTx4UaheSJk3Ngh4qSDYxqZ33g25epvEU ACKZSQyEWgXG1H+L9/XUkJlBC6wLrdrdkJOm3YrffUeouElgExz0qNOpIeC1GJKR2ke+ OaeiKob4P75RG6Ef6QlfipbkbEu3QKXqVf7t1bH8dlQWLekX4Oj0bAV0OMwWaei9PgHP xPNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A9BTVNSv; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8-v6si35190927plb.249.2018.10.22.03.21.59; Mon, 22 Oct 2018 03:22:14 -0700 (PDT) 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=@kernel.org header.s=default header.b=A9BTVNSv; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729103AbeJVSip (ORCPT + 99 others); Mon, 22 Oct 2018 14:38:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:49632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729088AbeJVSio (ORCPT ); Mon, 22 Oct 2018 14:38:44 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D0ABA20890; Mon, 22 Oct 2018 10:20:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540203650; bh=fkQM5544zFxxcSLREdgFQWUe3wDDzPwnqfCt2ptZR+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9BTVNSvQ3nlh2ti1oLEto0FKenbOi6C/P/Notary8NgbRZGfG9atpmq4Azx6kBGi ZeiM9Wgt5vrlNNZBGM+si2k+PjSWldHAdqgoyIQebTq9J9f5mztEBnv8n+jtPeI6co IEHLb7+AGnnoD8PGR7utRNNZLKCgXxUietIxz0FY= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Torokhov , Sasha Levin Subject: [PATCH AUTOSEL 4.14 07/15] Input: uinput - add a schedule point in uinput_inject_events() Date: Mon, 22 Oct 2018 06:20:18 -0400 Message-Id: <20181022102026.40869-7-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181022102026.40869-1-sashal@kernel.org> References: <20181022102026.40869-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Torokhov [ Upstream commit cecf10704899467a787975e3d94a1f0129b9688e ] Large writes to uinput interface may cause rcu stalls. Let's add cond_resched() to the loop to avoid this. Reviewed-by: Paul E. McKenney Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/misc/uinput.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 443151de90c6..13d17e85f2cf 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -561,6 +561,7 @@ static ssize_t uinput_inject_events(struct uinput_device *udev, input_event(udev->dev, ev.type, ev.code, ev.value); bytes += input_event_size(); + cond_resched(); } return bytes; -- 2.17.1