Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp32620imm; Fri, 31 Aug 2018 16:11:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaKRVnLqkb6aRt3hxn4g5BFkjZf1ItOFb4DLK+ZpTv5QPOsStKjctLLCE2E9kVg3zM4XBQh X-Received: by 2002:a62:9683:: with SMTP id s3-v6mr18185038pfk.191.1535757099072; Fri, 31 Aug 2018 16:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535757099; cv=none; d=google.com; s=arc-20160816; b=HqpRjYTYT3+A1rJEMvolY/qK5Fx78rmFwHAWP/H7bllZtvxTuQwRGiO5cXEI1K5jG5 DuYN9hVb/zqTlfgRLg1GEr14fyo88B65SAWUOy3Vd8kJO9H8P3M/mS1RtCMsIIvS6ezn L9dDTlYepV9shFncxZ6zTpWgcBUdLKOywnVL7GzDg6QRM+QWDsRvCKlpG1ls59gpKcAx nXmpHIXsMWNqVKnMyLjOetrPnBSocX4NlxZCeqRPO7FA55/UtuLSiNOXQGMhDUBmw8nf bBlRAJ2XSItnJ2ILFwl3ntpihBpDgrB7/CUkXqjzj06qCLYG5r02xHYJJKfK9KqpFAqt zzxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=rfQ7fOszyBR4X33vZU2tgI2PHUvxIMFVG3y/OfXq9MQ=; b=Xrdr34Z1aGAQZBfCigHiEQnasWVm4P8wuQo3N8JtYyNs0fDafO4fQE/BXvE3UUHVMF ROZ5f9S6Na3NPUB+S2zvziu8xZV2Zk/boWiaqt2CeTDSbbqruMxPefLI+6rIKH0zP8wo g9IhkQD8sdItNouml0zGeiK+lw3Y7zauCCcNdIxFTRVjKHJ0HyBjs+vJsyaBrzdXiQii FOFHkPfMO4ruXO9uZ5uHBMkhJ0L7jnRHQi+o4W708ar2JT6dNNlIiRKAT6kwstSnxQYu R9BxD+0eEtBvT+FUF8h/eerK1QADnh3bWKe673F/qPLQ2MgbHxhu7li4nWRVG2QUV426 9a8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FNNggnb5; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16-v6si10085282plp.317.2018.08.31.16.11.24; Fri, 31 Aug 2018 16:11: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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FNNggnb5; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727658AbeIADSt (ORCPT + 99 others); Fri, 31 Aug 2018 23:18:49 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36150 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727175AbeIADSt (ORCPT ); Fri, 31 Aug 2018 23:18:49 -0400 Received: by mail-pf1-f195.google.com with SMTP id b11-v6so6163050pfo.3; Fri, 31 Aug 2018 16:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rfQ7fOszyBR4X33vZU2tgI2PHUvxIMFVG3y/OfXq9MQ=; b=FNNggnb5yomOQ0mqu9hb0yDwun8qu2kojMi+naMHGeksWzHBrFOMPNmSC6cXiXLbP9 uKo0FUNisfOWa1qeH1xmuaT06fZdHgeWtlt2LwMr0P/mRlDFRFb0y6DuUYeJmOgPa0Bt UhSkwUU+5xEsrDFz+yAyASKEtXVgj4R5o1OK9h+yc/Ph7PpbT5E0SfknkmSCFQkZpcHB 3vLllZtIntYjPI8NpaF3cqxkcaJWbXUGOFo5lbIVvahMvfDoHmFbiiNzNm7acRcKHIHE 6FU5g+7xkea1cCD9YpahXhnjHaG1DOUE2vE0lJSI0lfKZ3t0hckMpIolrA3RZwhTk5pz DcTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=rfQ7fOszyBR4X33vZU2tgI2PHUvxIMFVG3y/OfXq9MQ=; b=Qg3NkRsRAdTmpGnYEQqLJq53LUStCFBA5Rj4uYupuVgd77U4bbP2fxXcOXbsHaUp2Y mP1oc2//Iwyc5STNF6WK8XaPCh7uZGFHfL4d+ylS2BlwOxLVsPoQYMJlEG+QzS/CsMvw bGybb/IM5ICGgCl8EyFhI8lNolQNz+xi5P/tgcRHdI7tg+ZQ6/HTOp8PWr2kh9FQxCFP Z3ooO+Fb4bB1VmTISO0cxnMye2HAG8BY4w7O0aaeGY0YPTBKfau8PIXIu4JNsxkS2F9M Vl3/0ymqrmBDIPPOxWlARmeMuEf0nI0z5kUSVRJZyEahN9FaAXB5TAXlN1siFDrxgukE vALw== X-Gm-Message-State: APzg51BnLb5tCt/CDJuhmS6E18198SGbS7uobSyTIL6Dzo5L56GHcgJv LvanQLvNaAV0fZWslekVwWM= X-Received: by 2002:a62:d2c4:: with SMTP id c187-v6mr18155099pfg.8.1535756946414; Fri, 31 Aug 2018 16:09:06 -0700 (PDT) Received: from localhost ([2620:10d:c090:180::1:a245]) by smtp.gmail.com with ESMTPSA id m27-v6sm10299615pff.152.2018.08.31.16.09.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 16:09:05 -0700 (PDT) Date: Fri, 31 Aug 2018 16:09:02 -0700 From: Tejun Heo To: Dennis Zhou Cc: Jens Axboe , Johannes Weiner , Josef Bacik , kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/15] blkcg: update blkg_lookup_create to do locking Message-ID: <20180831230902.GC1488037@devbig004.ftw2.facebook.com> References: <20180831015356.69796-1-dennisszhou@gmail.com> <20180831015356.69796-6-dennisszhou@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831015356.69796-6-dennisszhou@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 30, 2018 at 09:53:46PM -0400, Dennis Zhou wrote: > From: "Dennis Zhou (Facebook)" > > To know when to create a blkg, the general pattern is to do a > blkg_lookup and if that fails, lock and then do a lookup again and if > that fails finally create. It doesn't make much sense for everyone who > wants to do creation to write this themselves. > > This changes blkg_lookup_create to do locking and implement this > pattern. The old blkg_lookup_create is renamed to __blkg_lookup_create. > If a call site wants to do its own error handling or already owns the > queue lock, they can use __blkg_lookup_create. > > Signed-off-by: Dennis Zhou It looks a bit weird w/o actual users, might be worthwhile to mention that future patches will add users. Acked-by: Tejun Heo Thanks. -- tejun