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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C190C433E7 for ; Tue, 13 Oct 2020 02:55:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CBB320872 for ; Tue, 13 Oct 2020 02:55:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728399AbgJMCzd (ORCPT ); Mon, 12 Oct 2020 22:55:33 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:43451 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbgJMCzc (ORCPT ); Mon, 12 Oct 2020 22:55:32 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 09D2tTNR012025; Tue, 13 Oct 2020 04:55:29 +0200 Date: Tue, 13 Oct 2020 04:55:29 +0200 From: Willy Tarreau To: Linus Torvalds Cc: Linux Kernel Mailing List Subject: about prandom vs __this_cpu_read() Message-ID: <20201013025529.GA12006@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus, the latest prandom series I sent you changes __this_cpu_read() to this_cpu_read() since LKP returned the following trace on i386: [ 9.061912] dump_stack+0x54/0x6e [ 9.061912] check_preemption_disabled+0xb1/0xc0 [ 9.061912] __this_cpu_preempt_check+0xf/0x11 [ 9.065516] __igt_reserve+0x91/0x580 [ 9.065516] igt_reserve+0x5b/0xc0 [ 9.065516] test_drm_mm_init+0x78/0xa9 I got another report that it breaks on ARC (trivial fix consists in adding irqflags.h in prandom.h) but that made me wonder, we're using this to access and update the net_rand_noise variable only, wouldn't it be better to use the faster raw_cpu_read()/raw_cpu_write() there, considering we don't care about concurrent accesses since they simply add even more impredictability to the noise ? If so, I'll update this branch and will send you another PR. Thanks, Willy