Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp105692ybi; Fri, 26 Jul 2019 06:51:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDFQjMYeeKOls6gDoqy1AUZVNBQm+yHGcv+tFSG3n+U1kSNc5xtzBqh8psrhwISa2I0J4D X-Received: by 2002:a63:2148:: with SMTP id s8mr89465953pgm.336.1564149099165; Fri, 26 Jul 2019 06:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564149099; cv=none; d=google.com; s=arc-20160816; b=ax8sNRjvhIaqHObyuMbBjt1oTpPfnO+BmkLxSd1X0H2nBi3k95swxzAld0x68TTkgD rA7XOLzo/rLifCjsmrQncs91rBK0XUu0nn1SFrVa3rgSl77lsX5RdnipCyHvXxydaYRQ 4tGWwYfrPy/56oAHa1PayOaPA1+tV1ihFnj2UI/palDIX9gfZn/OtL7yZXaq+C+KlZ0O lZjyjK4b/A/QlKcpKjwmwEvgY4jRYHRyoR9GGQ1lDi538oWwKfAN0j3kSvl5VjGQE4hQ e7t38x5MSvsxcFJgA9QQIljyT6DxlpFDQR1CUFtlKV8WJj5D9uONcpDf96o9H1SvVD2e jgtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Arc7jiA/gNfqVVW7QNfgaMfkpV6mHYMiv3nUsNQh21Q=; b=vALnNEcF0bIa0M2YWo5Gji86ppjCisy0Jl/WBITA1WHpyOsEjG6o7HxS09aD4y9DRk IvuwZee465UVOJEeNTxzZuxkVVL8OIvbaz/LaBGbHzl23Hlj4pRxbxVZB6Fl1LCz/f8j 18Z21R+NHqs+E49yb7hrl7UbGolX7b7p0ty00v+JzpNFZxWvLHckxRm/eLetFs7yfZ23 PPdcixd5jSKRwRlyQHMmpXFGML9uM9Xo/Xo1wZhDVtM5IexRb3Qtug6XXv+V/PX8ChfI 7BsSyyq8a5DYNSdpl1+JLKnDKStkOmXHmglw5WS1ia9We4rZNYKbau02g8rS9auQ7bhw HrpA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si19775806pgt.258.2019.07.26.06.51.24; Fri, 26 Jul 2019 06:51:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388576AbfGZNt6 (ORCPT + 99 others); Fri, 26 Jul 2019 09:49:58 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41373 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388813AbfGZNtt (ORCPT ); Fri, 26 Jul 2019 09:49:49 -0400 Received: by mail-qt1-f196.google.com with SMTP id d17so52532561qtj.8 for ; Fri, 26 Jul 2019 06:49:49 -0700 (PDT) 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:content-transfer-encoding :in-reply-to; bh=Arc7jiA/gNfqVVW7QNfgaMfkpV6mHYMiv3nUsNQh21Q=; b=C1TOqzmGmMDDx5+78B9o2F0tV4pBewaMghEvZOibsG9uBC0iJjkWS10rScwGb8MQXu E8bEdIgx7GxELdWy39CftqcUVHWOHAJBWh8FWM+gAd6lE9NUWhuKbjU+ZwO2L/+tr0l0 CsDOeGuvxwMReKnskimxKVhc7XdbQ6CEiU085ZNuD2nTpGtlJR0J0f0bmrNUKj6GarUc JnHNRBh8b1FGthdRayHxiUkTozJRSQVRVKM2sdpj9qXR7min1Vew+27oUKVbjoPjPtVu R8OXeNZ8WfF893RbAGWvvoOakIfjii4ya7icgVJp7UKgmLPdaRtXl9QCB5Ix6woCkJOo mmeA== X-Gm-Message-State: APjAAAWyA48PT8RjQuWfni+DeYhMXEk15FBnGxRY2AtwnVrawZIh3pza VGnWqJVTdAwAE3VEgB4xu2TkcQ== X-Received: by 2002:a0c:9233:: with SMTP id a48mr67054287qva.66.1564148988892; Fri, 26 Jul 2019 06:49:48 -0700 (PDT) Received: from redhat.com ([212.92.104.165]) by smtp.gmail.com with ESMTPSA id w19sm20959381qkj.66.2019.07.26.06.49.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 06:49:48 -0700 (PDT) Date: Fri, 26 Jul 2019 09:49:39 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: syzbot , aarcange@redhat.com, akpm@linux-foundation.org, christian@brauner.io, davem@davemloft.net, ebiederm@xmission.com, elena.reshetova@intel.com, guro@fb.com, hch@infradead.org, james.bottomley@hansenpartnership.com, jglisse@redhat.com, keescook@chromium.org, ldv@altlinux.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, luto@amacapital.net, mhocko@suse.com, mingo@kernel.org, namit@vmware.com, peterz@infradead.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk, wad@chromium.org Subject: Re: WARNING in __mmdrop Message-ID: <20190726094756-mutt-send-email-mst@kernel.org> References: <55e8930c-2695-365f-a07b-3ad169654d28@redhat.com> <20190725042651-mutt-send-email-mst@kernel.org> <84bb2e31-0606-adff-cf2a-e1878225a847@redhat.com> <20190725092332-mutt-send-email-mst@kernel.org> <11802a8a-ce41-f427-63d5-b6a4cf96bb3f@redhat.com> <20190726074644-mutt-send-email-mst@kernel.org> <5cc94f15-b229-a290-55f3-8295266edb2b@redhat.com> <20190726082837-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 09:36:18PM +0800, Jason Wang wrote: > > On 2019/7/26 下午8:53, Jason Wang wrote: > > > > On 2019/7/26 下午8:38, Michael S. Tsirkin wrote: > > > On Fri, Jul 26, 2019 at 08:00:58PM +0800, Jason Wang wrote: > > > > On 2019/7/26 下午7:49, Michael S. Tsirkin wrote: > > > > > On Thu, Jul 25, 2019 at 10:25:25PM +0800, Jason Wang wrote: > > > > > > On 2019/7/25 下午9:26, Michael S. Tsirkin wrote: > > > > > > > > Exactly, and that's the reason actually I use > > > > > > > > synchronize_rcu() there. > > > > > > > > > > > > > > > > So the concern is still the possible synchronize_expedited()? > > > > > > > I think synchronize_srcu_expedited. > > > > > > > > > > > > > > synchronize_expedited sends lots of IPI and is bad for realtime VMs. > > > > > > > > > > > > > > > Can I do this > > > > > > > > on through another series on top of the incoming V2? > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > The question is this: is this still a gain if we switch to the > > > > > > > more expensive srcu? If yes then we can keep the feature on, > > > > > > I think we only care about the cost on srcu_read_lock() > > > > > > which looks pretty > > > > > > tiny form my point of view. Which is basically a > > > > > > READ_ONCE() + WRITE_ONCE(). > > > > > > > > > > > > Of course I can benchmark to see the difference. > > > > > > > > > > > > > > > > > > > if not we'll put it off until next release and think > > > > > > > of better solutions. rcu->srcu is just a find and replace, > > > > > > > don't see why we need to defer that. can be a separate patch > > > > > > > for sure, but we need to know how well it works. > > > > > > I think I get here, let me try to do that in V2 and > > > > > > let's see the numbers. > > > > > > > > > > > > Thanks > > > > > > > > It looks to me for tree rcu, its srcu_read_lock() have a mb() > > > > which is too > > > > expensive for us. > > > I will try to ponder using vq lock in some way. > > > Maybe with trylock somehow ... > > > > > > Ok, let me retry if necessary (but I do remember I end up with deadlocks > > last try). > > > Ok, I play a little with this. And it works so far. Will do more testing > tomorrow. > > One reason could be I switch to use get_user_pages_fast() to > __get_user_pages_fast() which doesn't need mmap_sem. > > Thanks OK that sounds good. If we also set a flag to make vhost_exceeds_weight exit, then I think it will be all good. -- MST