Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3717796ybi; Mon, 27 May 2019 04:58:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpzKfGKBKevygKT1Ve6AXAkvVOguj9Sv+tg87PiWg2m1mj3u2Gkpq0W2LBDFVYDB49t6Z5 X-Received: by 2002:aa7:9ac4:: with SMTP id x4mr134653887pfp.43.1558958299974; Mon, 27 May 2019 04:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558958299; cv=none; d=google.com; s=arc-20160816; b=mhSy+sNY1hPP6qs/mjYzidEcYwQ6FOWuk2lD4sJ/cpyXAVWOvJEYHlMiSa90U+eJY9 VlizGQByNfCTQepRSP2jTav8y2TicgUBgCVLIl3ZEts1Scx+4W992QS7o38gzoyQg4M9 aYML1P5dn2NKrzeLDtTBrGChTs5GI3+HKvMj37/KWPb8NINdics+sFMrar1S/RFEhz9k nQ7xv6uxcbDOBq/oBLm2DxXeBMbMtxiYghFK4bVIr0lcqDvG+xvo2cYRPXnAQ7XrmkHB xBqpIkqzpLxnszEBwMQl22ybEt9ZIJ5f9HhUPBJVDEs7FwNAJf/iQTZEptnkji8BX45N yJAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SqMfg6OHmKKEB+7R/k2mN5jX74nLf2tODcyGqdJKodU=; b=yUcspuDRwqWax0DjYiAMNcQl1Kgc2ZJkuXQM+579iELPtLdH7c/Y3yTlNTLOksL0+G sA/qVowrELimhoZsRZWOkna2uT2W74Rduz9X8G4Ug6A4w6JvPcFf7XyTxK6oQp0B5TNd LaXlnlN1B3duk2XjnfGVFo7jXfNnRE2GCE2aAB3j7MAOCZSvV/SGBBO6clG3F3h44eri Mt6wWx0idk7Lb10BT649/HR5/fqbpk55npXp+F05dHTxVO9Zm7kxyLtfDIf1k9pugzZs 1FBeJH4rCkPtcIfmd7OvXoDIrde3+P10DRZCn8gKZhp4bBsAEg0yIpjcCZ9mzOfRcdiq dgXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=FpcZQCd+; 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 90si17936058pla.323.2019.05.27.04.58.04; Mon, 27 May 2019 04:58:19 -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=@ffwll.ch header.s=google header.b=FpcZQCd+; 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 S1726689AbfE0L5C (ORCPT + 99 others); Mon, 27 May 2019 07:57:02 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:40705 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfE0L5B (ORCPT ); Mon, 27 May 2019 07:57:01 -0400 Received: by mail-oi1-f193.google.com with SMTP id r136so11704316oie.7 for ; Mon, 27 May 2019 04:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SqMfg6OHmKKEB+7R/k2mN5jX74nLf2tODcyGqdJKodU=; b=FpcZQCd+yUainAstvP1yxc+17OcnChNGqTLXsysGDBaXKdGMDd6Htb8Ys97/PVyWWk 2dDkk0d7ahb5BX+NBxNbMk9dxe2Co6GuXgZlPVZBET28ScnhUF/KeFm5OvidwSI28fTy 24rT9rCGSqykbg+wbqgIVubVQ9w3Hy97uj/So= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SqMfg6OHmKKEB+7R/k2mN5jX74nLf2tODcyGqdJKodU=; b=SOV+sdQBxW4rXmM9E1Ri1+1+HP1ZZr5xoWq62iC7Z/1fI0oNCPyxt24GN6aekJuXld Ize8t7pyn/WHkrYqD1LQf5G1SxKhyA45kqng9zuiBDfPV8UZQ+XhzCLhbhAYFyVihLLB LHqWJ1v4++uVtojum4mjx8CNZsOwA+1IwPHoUKAFFxm/w88XRAwQL+yxovpIfsnHN+Gp Di8QW2iLj+eavao6o0O+FPsGnkUjqZQexQuyboowyxKEY4Fzg7FwxlTcdr9sJarDZ8vc 6Vu7FBWQCzJouh19cb4akcFBrDLnoIPin42fOXQaB71I0wFSmYsIHNxUTjPQymjk/How MOTg== X-Gm-Message-State: APjAAAXMjnA1Q6hSvNhXFWXCenWSAfl25ziMgIIh6C4yT/m+W/nTywIb z3ODv7Jqy3dFz3wBRhMRurmDPP83T3gb3KfOfEuwthJn X-Received: by 2002:aca:31cf:: with SMTP id x198mr14016323oix.132.1558958220929; Mon, 27 May 2019 04:57:00 -0700 (PDT) MIME-Version: 1.0 References: <20190524085354.27411-1-daniel.vetter@ffwll.ch> <20190525171928.GA13526@ravnborg.org> <20190527071729.GM21222@phenom.ffwll.local> In-Reply-To: <20190527071729.GM21222@phenom.ffwll.local> From: Daniel Vetter Date: Mon, 27 May 2019 13:56:48 +0200 Message-ID: Subject: Re: [PATCH 00/33] fbcon notifier begone! To: Sam Ravnborg Cc: LKML , Intel Graphics Development , DRI Development Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 27, 2019 at 9:17 AM Daniel Vetter wrote: > > On Sat, May 25, 2019 at 07:19:28PM +0200, Sam Ravnborg wrote: > > Hi Daniel. > > > > Good work, nice cleanup all over. > > > > A few comments to a few patches - not something that warrant a > > new series to be posted as long as it is fixed before the patches are > > applied. > > Hm yeah good idea, I'll add that to the next version. Actually I thought a bit more about the locking story, and it's a bit worse than my simple plan here. I think better to just have that floating around, and not make it look like it's an easy simple cleanup. The case I forgot about is that any places that has a printk can recurse through the console_lock, which means we need a lot more try_lock than I originally thought we'd need. -Daniel > > > > btw for future plans: I think this is tricky enough (it's old code and all > > > that) that we should let this soak for 2-3 kernel releases. I think the > > > following would be nice subsequent cleanup/fixes: > > > > > > - push the console lock completely from fbmem.c to fbcon.c. I think we're > > > mostly there with prep, but needs to pondering of corner cases. > > I wonder - should this code consistently use __acquire() etc so we could > > get a little static analysis help for the locking? > > > > I have not played with this for several years and I do not know the > > maturity of this today. > > Ime these sparse annotations are pretty useless because too inflexible. I > tend to use runtime locking checks based on lockdep. Those are more > accurate, and work even when the place the lock is taken is very far away > from where you're checking, without having to annoate all functions in > between. We need that for something like console_lock which is a very big > lock. Only downside is that only paths you hit at runtime are checked. > > > > - move fbcon.c from using indices for tracking fb_info (and accessing > > > registered_fbs without proper locking all the time) to real fb_info > > > pointers with the right amount of refcounting. Mostly motivated by the > > > fun I had trying to simplify fbcon_exit(). > > > > > > - make sure that fbcon call lock/unlock_fb when it calls fbmem.c > > > functions, and sprinkle assert_lockdep_held around in fbmem.c. This > > > needs the console_lock cleanups first. > > > > > > But I think that's material for maybe next year or so. > > Or maybe after next kernel release. > > Could we put this nice plan into todo.rst or similar so we do not have > > to hunt it down by asking google? > > > > For the whole series you can add my: > > Reviewed-by: Sam Ravnborg > > > > Some parts are reviewed as "this looks entirely correct", other parts > > I would claim that I actually understood. > > And after having spend some hours on this a r-b seems in order. > > Thanks, Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch