Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5827275imm; Mon, 23 Jul 2018 06:48:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1isi5ZhHegSpIDjIFSGOabJq2OFk/IrE1qT5Xeb4nxxrBWXf8bAOLYM/+EF/rSXxJws+9 X-Received: by 2002:a17:902:20e3:: with SMTP id v32-v6mr4396628plg.232.1532353720643; Mon, 23 Jul 2018 06:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532353720; cv=none; d=google.com; s=arc-20160816; b=iqJFzGs8xocnxr2XbMwEa/0ev+jDDd2x03C4fwmdZN0NlibTL1NNsBQk7oRAcuIEw6 SO1zI9e7/uhvk+SdCckV8TyVZ1cIAu0+2nzaHRasVejU/Aq/kclco0/kgBf8LHq04ya+ VvLmbAM/rYRFcqckBnBzpZUJhRKszQQtYZcJ477N5Ouobb5eWhP8qpp6zV4RBiGlqHgl Vopl1s7upwFLNnof3xorM1GO/VjFHNr7Df+SCm35Cktkl/Q+XyXE83k/dIHNT6otDwjD RbB4c2SFHAmAEyJ7IaqmFb1bZs5M8Oq0yQJM9i/cuo2FpW64vRg9yRFG50JkCUkLaHB2 sb7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=TA1CwUvIj6HrSJJobean6qwGmIO0QBzk3xJHXyhoOZg=; b=AXuomDEUA+d64guMH9ULfxq9cpV0/ZW6q1LPD9r0NNukFXRQXiU/x/fCW+zzpxjMAu e7+eSVgyhRHcPU4hZ3LG/Szu5/N14WQkdndNGSFRp3EwfdoXIvYCn0yRP77059tY4sVj 9oRAT2CZkjXT4PLVku3gVnPu/HtwedFwqQtTpMIhVc3sn8EGkGuPknqjSuJpv3IZEbsm g7SUAqPylcouok6Xl0geHsUINXjbikyGwPqImc9kgkWybMXYSUipl3GIQuYuvW4zUexN Mn7wgmu6b8yg4VeVstwvkAPqrrt1WDvQOBhp5aBAQ5x6oBRyLxKjh2kAyWiegKZY6vOt hy3w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si7893009plr.365.2018.07.23.06.48.25; Mon, 23 Jul 2018 06:48:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388415AbeGWOsp (ORCPT + 99 others); Mon, 23 Jul 2018 10:48:45 -0400 Received: from mail.bootlin.com ([62.4.15.54]:54256 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388129AbeGWOsa (ORCPT ); Mon, 23 Jul 2018 10:48:30 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id F15A12093A; Mon, 23 Jul 2018 15:47:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from windsurf (176.199.29.109.rev.sfr.net [109.29.199.176]) by mail.bootlin.com (Postfix) with ESMTPSA id 8D9FC20717; Mon, 23 Jul 2018 15:46:57 +0200 (CEST) Date: Mon, 23 Jul 2018 15:46:57 +0200 From: Thomas Petazzoni To: Sergei Shtylyov Cc: Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arch/sh: use slow path for get_user_pages_fast() on SMP Message-ID: <20180723154657.3872fa70@windsurf> In-Reply-To: <474bbdcc-d78f-faa0-b2c3-3650cc870b36@cogentembedded.com> References: <20180615155237.8166-1-thomas.petazzoni@bootlin.com> <474bbdcc-d78f-faa0-b2c3-3650cc870b36@cogentembedded.com> Organization: Bootlin (formerly Free Electrons) X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, 15 Jun 2018 19:04:45 +0300, Sergei Shtylyov wrote: > Hello! > > On 06/15/2018 06:52 PM, Thomas Petazzoni wrote: > > > The fast path of get_user_pages_fast() disables IRQs and then does: > > > > - gup_pud_range() > > - gup_pmd_range() > > - gup_pte_range() > > - flush_dcache_page() > > > > However, flush_dcache_page() makes a smp_call_function(), and using > > smp_call_function() when IRQs are disabled is not allowed. > > > > In order to work around this problem, this commit prevents the fast > > path from get_user_pages_fast() from being used on SMP, and directly > ^^^^ of? > Else it sounds a bit tautological... Yes, agreed. I can fix that up for a v2, or perhaps such a small typo can be fixed while applying the patches. Could someone review and/or merge those patches ? I sent four patches, which are still pending: [PATCH] arch/sh: kernel: use KERN_CONT in print_sh_insn() [PATCH] arch/sh: kernel: use KERN_CONT in dump_mem() [PATCH] arch/sh: fix SH4 flush_dcache_all() for SMP [PATCH] arch/sh: use slow path for get_user_pages_fast() on SMP Note that this last one is more a workaround than a proper fix. It does the job, but there is very likely a better solution, and I was hoping to get some insights/suggestions. Thanks a lot, Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com