Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3347364imm; Sun, 14 Oct 2018 18:07:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV61i0T94NUQAiWGy5f7129h9lodmAxK74ZrrXRagzDz+s1mK1woRI4QfJcqWKfJ+qug6tLgV X-Received: by 2002:a17:902:59dc:: with SMTP id d28-v6mr15001941plj.116.1539565662672; Sun, 14 Oct 2018 18:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539565662; cv=none; d=google.com; s=arc-20160816; b=en856CSIqXYl8Un2fD8fOuXkCgRzV8OO254xKlRFNZMjvJuh0pWC6KGL/j3YCab8Sx PpdOnzYuJti+D31RDWIZ/7CbrMqwtngCuhJUGfIwYFhsajabVwCc1syqJ3vJPE0Ax9sy s/39k0jABGCtVcyJwzhJQBIqHQeBrRHrcCmPpctOETmsBDAxn5jmF07PfWqu6T53L+bh I2SQa8bkWw6zHMpSFlSLRjRBbgGYfmPgpfgTVXj8yshrwByDgceOi3TpMyWcURfyhZuH VCQ1whMVuGRVIKtskIlXdVTnby4UbJ+ZfHj5WBIJxbMV4xBE0MeGtSSH4KEYHSMWMn52 XKGg== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=3BVemQOvE2hTOAJkxv6xCYF0QTq6rOTiK145DvEwP6A=; b=lRrqOuBIB44YUMjOGTvLKersAV/RW/WWNsx5SwFLhineOb5uZKa2dv2vN8fF/PdXMQ yk0vovhIOF7/h6QOOmdJHqTlKMuYyYmza1xo6AKS8Na2F3efBDw88bpldrWDwaP/GpLA ug84P7AqVnegkXOqjPL5Qq3BMksv3I7FBlqqlySyoMVXkBlXhHzu1u5lzfSJssRWxz25 Grm+KjeJEajBaiqPGdzNk5aA5dKNcUbe6mqrx/B2KpnCdrTkteIbhxeehJo1KfmbNrpk ACUBwLmdCD92xHQBzhVyIDMIKWO9643LyzYDBz74YNeu+8wxPTnGmY+R14klBnmYa4eA T6MA== 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 o127-v6si9028621pfb.128.2018.10.14.18.07.12; Sun, 14 Oct 2018 18:07:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbeJOItk (ORCPT + 99 others); Mon, 15 Oct 2018 04:49:40 -0400 Received: from smtprelay0235.hostedemail.com ([216.40.44.235]:58313 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726357AbeJOItk (ORCPT ); Mon, 15 Oct 2018 04:49:40 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id B6F8C83777EE; Mon, 15 Oct 2018 01:06:43 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3868:3870:3871:3872:4321:4385:4605:5007:7514:7576:9010:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12296:12438:12740:12760:12895:13069:13255:13311:13357:13439:14181:14659:14721:21080:21324:21451:21627:21789:30012:30029:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:28,LUA_SUMMARY:none X-HE-Tag: home21_5785f54ad7d03 X-Filterd-Recvd-Size: 3091 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Mon, 15 Oct 2018 01:06:41 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3 13/18] of: overlay: check prevents multiple fragments touching same property From: Joe Perches To: frowand.list@gmail.com, Rob Herring , Pantelis Antoniou , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Alan Tull , Moritz Fischer Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-fpga@vger.kernel.org Date: Sun, 14 Oct 2018 18:06:40 -0700 In-Reply-To: <1539563070-12969-14-git-send-email-frowand.list@gmail.com> References: <1539563070-12969-1-git-send-email-frowand.list@gmail.com> <1539563070-12969-14-git-send-email-frowand.list@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2018-10-14 at 17:24 -0700, frowand.list@gmail.com wrote: > From: Frank Rowand > > Add test case of two fragments updating the same property. After > adding the test case, the system hangs at end of boot, after > after slub stack dumps from kfree() in crypto modprobe code. [] > -static int check_changeset_dup_add_node(struct overlay_changeset *ovcs) > +static int changeset_dup_entry_check(struct overlay_changeset *ovcs) > { > - struct of_changeset_entry *ce_1, *ce_2; > - char *fn_1, *fn_2; > - int name_match; > + struct of_changeset_entry *ce_1; > + int dup_entry = 0; > > list_for_each_entry(ce_1, &ovcs->cset.entries, node) { > - > - if (ce_1->action == OF_RECONFIG_ATTACH_NODE || > - ce_1->action == OF_RECONFIG_DETACH_NODE) { > - > - ce_2 = ce_1; > - list_for_each_entry_continue(ce_2, &ovcs->cset.entries, node) { > - if (ce_2->action == OF_RECONFIG_ATTACH_NODE || > - ce_2->action == OF_RECONFIG_DETACH_NODE) { > - /* inexpensive name compare */ > - if (!of_node_cmp(ce_1->np->full_name, > - ce_2->np->full_name)) { > - /* expensive full path name compare */ > - fn_1 = kasprintf(GFP_KERNEL, "%pOF", ce_1->np); > - fn_2 = kasprintf(GFP_KERNEL, "%pOF", ce_2->np); > - name_match = !strcmp(fn_1, fn_2); > - kfree(fn_1); > - kfree(fn_2); > - if (name_match) { > - pr_err("ERROR: multiple overlay fragments add and/or delete node %pOF\n", > - ce_1->np); > - return -EINVAL; > - } > - } > - } > - } > - } > + dup_entry |= find_dup_cset_node_entry(ovcs, ce_1); > + dup_entry |= find_dup_cset_prop(ovcs, ce_1); I think this is worse performance than before. This now walks all entries when before it would return -EINVAL directly when it found a match.