Received: by 10.223.185.116 with SMTP id b49csp887wrg; Mon, 19 Feb 2018 15:18:00 -0800 (PST) X-Google-Smtp-Source: AH8x224jK1bUm1GKFcr2OyrITvrYiAA71MOEp/TbXmsjEvsP7xjcXgLof2zcBBMyOYNG62ciLSWa X-Received: by 10.99.99.2 with SMTP id x2mr13595170pgb.406.1519082280267; Mon, 19 Feb 2018 15:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519082280; cv=none; d=google.com; s=arc-20160816; b=K9fF50qwm1KTV6D5RWFJ1cHuAV7EKBZUMffg4/jMFGj1QA6abaK7XfX6hRs2s3Y1Sw bcJZeubsBSDMcZgUQfBgCYlF9+8l6MfJ2aDktXgJVV9DygSC0hJREavvfKt3zkEy3mFz Y9S5G7FFQm+MAgNQHhPdYjfgAU/AVTCGZNN0nbz9hBIKLMaz5WoYvqO2alKgbSEx0Roj c70J6OCRFaWjid3qS0CHv1bzxIDy6QG9yCUBc07Z7QVpQ0ONeXWJVL70gruG5j1mUFic uEZd4aKLY63wKPACJBxMOcTbXr14PF3RiHBFnu1hXvucHZZ4dzU6N05zrY4sRb9PyX0u 9cNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=pI3q60f1jPZRF+qUVERQ0DUe6KlGG8kxtFhiEvRV75k=; b=tI/B3kFT3GAwTuyiMnkqQSv6XQdPa3xkUR/JkrqazoOj9GikR52H+vM58wPfM3LR6D l/dDz6p5YtUve7Om/3UbNCjEm7Z/FID+6cjWZFhkVwjdR1X8XIVsNidmuw4rGpgv1NLq 5o9LJzKyLhq4za/d3O8rCM+60SSCqiKe0k4MgX5EnribbnLbkZqoxNa+r/aknQUBappU fghwpw3PnTX3yPEr8bdmFTzAN88jKQtEQrbwefpHlvtLpzMzelob3LzZsoMsKGavtNmx G6LbQw6xjnc1mdAB366wwe+xpKuIu7NJ3POFOZuTuHhZCH4uAtu9aYbvdElpF2XRYcTq nyFw== 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 d81si10170966pfd.139.2018.02.19.15.17.45; Mon, 19 Feb 2018 15:18:00 -0800 (PST) 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 S932256AbeBSXRA (ORCPT + 99 others); Mon, 19 Feb 2018 18:17:00 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:60409 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbeBSXQ7 (ORCPT ); Mon, 19 Feb 2018 18:16:59 -0500 Received: from [37.81.189.72] by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1enucb-0005ZL-13; Tue, 20 Feb 2018 00:13:21 +0100 Date: Tue, 20 Feb 2018 00:16:55 +0100 (CET) From: Thomas Gleixner To: Reinette Chatre cc: fenghua.yu@intel.com, tony.luck@intel.com, gavin.hindman@intel.com, vikas.shivappa@linux.intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH V2 06/22] x86/intel_rdt: Create pseudo-locked regions In-Reply-To: <97148038-6af3-aa49-d5ac-35741867dd29@intel.com> Message-ID: References: <17cceeb077f3ac5f50b110285b36905091a345b0.1518443616.git.reinette.chatre@intel.com> <97148038-6af3-aa49-d5ac-35741867dd29@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Feb 2018, Reinette Chatre wrote: > On 2/19/2018 12:57 PM, Thomas Gleixner wrote: > > On Tue, 13 Feb 2018, Reinette Chatre wrote: > > > >> System administrator creates/removes pseudo-locked regions by > >> creating/removing directories in the pseudo-lock subdirectory of the > >> resctrl filesystem. Here we add directory creation and removal support. > >> > >> A "pseudo-lock region" is introduced, which represents an > >> instance of a pseudo-locked cache region. During mkdir a new region is > >> created but since we do not know which cache it belongs to at that time > >> we maintain a global pointer to it from where it will be moved to the cache > >> (rdt_domain) it belongs to after initialization. This implies that > >> we only support one uninitialized pseudo-locked region at a time. > > > > Whats the reason for this restriction? If there are uninitialized > > directories, so what? > > I was thinking about a problematic scenario where an application > attempts to create infinite directories. All of these uninitialized > directories need to be kept track of before they are initialized as > pseudo-locked regions. It seemed simpler to require that one > pseudo-locked region is set up at a time. If the application is allowed to create directories then it can also create a dozen unused resource control groups. This is not a Joe User operation so there is no problem. > >> +/* > >> + * rdt_pseudo_lock_rmdir - Remove pseudo-lock region > >> + * > >> + * LOCKING: > >> + * Since the pseudo-locked region can be associated with a RDT domain at > >> + * removal we take both rdtgroup_mutex and rdt_pseudo_lock_mutex to protect > >> + * the rdt_domain access as well as the pseudo_lock_region access. > > > > Is there a real reason / benefit for having this second mutex? > > Some interactions with the pseudo-locked region are currently done > without the need for the rdtgroup_mutex. For example, interaction with > the character device associated with the pseudo-locked region (the > mmap() call) as well as the debugfs operations. Well, yes. But none of those operations are hot path so having the double locking in lots of the other function is just extra complexity for no real value. Thanks, tglx