Received: by 10.192.165.148 with SMTP id m20csp1520360imm; Sat, 21 Apr 2018 09:57:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+XR2s/lpqeYRt8FVJ0Y5gaABU/+7W8UWN9c5ZkpvfoSg4lck62fjecCifPuq+cfmYYlRwp X-Received: by 10.99.116.76 with SMTP id e12mr11716463pgn.270.1524329857908; Sat, 21 Apr 2018 09:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524329857; cv=none; d=google.com; s=arc-20160816; b=l205Ebd+WMn8YdK9jATg+2STs6Cpc1//15hlgvWd1nBsZJH6MG5/2q5JGQrSgOBdwC 1o3hnW45f/sI3K8wf4CNRvGW0wfUzgU1rs7KjSlGUPeCKlpWcORZEsD6Im8yzLgIWJFF 8b2zaQCcHjGxWlO4CLoSO+dF8pse/FVUdnh/x9cQ8tecJHrDFiTgVFdYP3AJzuvWKqS0 AslkAIEcu+sXOiMldCrPn3Yf4jZO5jQ5yKqBZ0juhd9VkiqanROyfkMce4I8+gehQ/+y dURPRPai5Jl4qLW/OATdWPvK0RIIZAKdZWNQBUZaSZCgfTFJiwbvEUqRLbwxy+rnV7OH HIIg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=7Nui42hHy3GEJhQCVzW+NA04XtiHtpcTb7nUBurhlBg=; b=oy9J4MjUZjW7mecXITSTIcIqsPasgT0aoeG632uQT9LhtwCLp1jOSajUtPGOVX9d3u J5faqrNkPILN4ZE5J0b6NFmHqywqcs8ok9mldtRIKiQW2pTRhikE4r0Ns2KUK4mLvC2P du9n6cY1TQ+Yux2yaWdW5tlvXEJw5MmyzD8KGIkfMO3f5Hfs6yGdgWjnlaBOpdFaogtv MNYKubBHYoQ89gox1kT3USvkJmcGscosmuGQv1/Pw6gTOZi5RPV769G6Loa3XLPH+ZyQ slhpFTJ20LRZfyiMU5U9IHCVH/U3MXmm8KmTXZVqoKcgVD5a4v9UyV+C40lypDWcP4UR j4hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YynlQTKo; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u184si1756019pgc.223.2018.04.21.09.57.11; Sat, 21 Apr 2018 09:57:37 -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=@gmail.com header.s=20161025 header.b=YynlQTKo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753226AbeDUQzM (ORCPT + 99 others); Sat, 21 Apr 2018 12:55:12 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34354 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbeDUQzK (ORCPT ); Sat, 21 Apr 2018 12:55:10 -0400 Received: by mail-pg0-f67.google.com with SMTP id p10so5485065pgn.1; Sat, 21 Apr 2018 09:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7Nui42hHy3GEJhQCVzW+NA04XtiHtpcTb7nUBurhlBg=; b=YynlQTKozvh+iTaREdjRvwQW7Pq0982CmuffQNkkcLv7AOW160YS1RvkYk5MSXoDOe qoYAdtKGDSsW2ubXIRKyZ9OZ6cPapsjpkZYlKB8uJmhzyjda3WlYzjCub6/iXRFWoH/X iKhUQHeoz3cBVcehakk42iurDdrfQl/GrbtvhViYb2f7lZegehT719byuO8uLc69kJiz vTIWeWo0JYHgbrpyTnx1sIVEVs0uwQIli7hE2z2naQf+RqsOpn9xOpYVNQ6+lQIoRUWw HnWyByWuaIn7iDNiBc7OvQ5y8Gft7+Vg0M7QPxR+z4f7k8+F7YbM7fmH8lVgUQNtnIy+ wjTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7Nui42hHy3GEJhQCVzW+NA04XtiHtpcTb7nUBurhlBg=; b=RuFLiTagD9Uo39TsqsK0b8a/NzQfH1i1JOXRvi0qtt6rDqI6mdnp5rYMc+r75owk/4 vafh5DI/IJtuvvfyo4wzpCCQIyigmzmFZUIyTQ+Vc8HZKeenzH+iwhfuMT7BlXuUE5ir 9poputZxKrVgyvYzmU6luL5I/29c7H8eviDd/9tP99C4tC0Wwco8okpRtEYuAJyA5rM9 syXNfLjipSZncM+pFwOvjnj1vtKlIEmmpF20MSTF2OqCW/vou33ErP5XJ9rzCydnplsb S5hEBD+CY2QklefjychdNF5jrDLOK+1BzEaly0UHKzDMrmS667rIyqY1QBiXKqXiO6w3 9BkA== X-Gm-Message-State: ALQs6tAjAgJPJGtTptyCr9VlSYTSY9VzNxzcFN7DzIAFeKF/OY6hr6ne 4L9/WAvC6edmQz6k7ZFvX8pvaCLL X-Received: by 10.99.119.78 with SMTP id s75mr11830544pgc.162.1524329709721; Sat, 21 Apr 2018 09:55:09 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id c184sm6472318pfc.180.2018.04.21.09.55.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Apr 2018 09:55:08 -0700 (PDT) Subject: Re: [PATCH net-next 0/4] mm,tcp: provide mmap_hook to solve lockdep issue To: Christoph Hellwig , Eric Dumazet Cc: "David S . Miller" , netdev , linux-kernel , Soheil Hassas Yeganeh , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org References: <20180420155542.122183-1-edumazet@google.com> <20180421090722.GA11998@infradead.org> From: Eric Dumazet Message-ID: Date: Sat, 21 Apr 2018 09:55:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180421090722.GA11998@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/21/2018 02:07 AM, Christoph Hellwig wrote: > On Fri, Apr 20, 2018 at 08:55:38AM -0700, Eric Dumazet wrote: >> This patch series provide a new mmap_hook to fs willing to grab >> a mutex before mm->mmap_sem is taken, to ensure lockdep sanity. >> >> This hook allows us to shorten tcp_mmap() execution time (while mmap_sem >> is held), and improve multi-threading scalability. > > Missing CC to linu-fsdevel and linux-mm that will have to decide. > > We've rejected this approach multiple times before, so you better > make a really good argument for it. > Well, tcp code needs to hold socket lock before mm->mmap_sem, so current mmap hook can not fit. Or we need to revisit all code doing copyin/copyout while holding a socket lock. (Not feasible really) > introducing a multiplexer that overloads a single method certainly > doesn't help making that case. Well, if you refer to multiple hooks instead of a single one, I basically thought that since only TCP needs this hook at the moment, it was not worth adding extra 8-bytes loads for all other mmap() users. I have no issue adding more hooks and more memory pressure if this is the blocking factor. We need two actions at this moment, (to lock the socket or release it) and a third one would allow us to build the array of pages before grabbing mmap_sem (as I mentioned in the last patch changelog)