Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5580030imm; Sun, 26 Aug 2018 23:57:57 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbml8pJSuFKw4Xn1X+jUjEGla3dG5y0jKb3DYXz/dLujJ0T+KJCfvJxnF2nvGpWkNdSaFO0 X-Received: by 2002:a62:591a:: with SMTP id n26-v6mr13081142pfb.94.1535353077328; Sun, 26 Aug 2018 23:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535353077; cv=none; d=google.com; s=arc-20160816; b=iiEDcJAzyFo6StUesVedYfLReB2/MKnHItqc3fIQ5NygyJUf3NHqGq0QmMMbvPcMk3 4ckPdVM57akUJ8XNPZWr5STE4fdA+Nre/NvOGmIj6304PysKagTQ6VsyfD+hTUBYgUX3 7JHYHk2obkWkCQQbLbjREAG6GkZErPEp3QIhItQQb9lR0dgVtBO+zfl4eurhZH27Q7ZB 9vVH10SXJt2Zys1YLchEgwWnU3id1MuKbUpeiP8imlR2PwtPTVfypP4IagBmBEle0H9l cw+squMTD5aHHA5l+o6/aI2nAEg3S7daZ//QXtMBV9+r7Kmg4OJC5pDn1hPUql5EYlnr ksgQ== 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:references:cc:to:from:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=Bi6u5bwIYLjKJwVu0l7sLib811HcJendBrgX1kG/6sc=; b=Eg8IUwrc/vNfTld8mgUR7jj8F5BLng0qzalqY8WzveM6zWLqJvL9dHiAXM/KutmOjF W9CpJOdQp5H9l1tZ1KBBrxa+d3//O5Do4KiJAF8VDRdukQpQYOmlLK8rJNx/kC3Rav5F mF/xh78eP7ZmhGH5HIXFuY2FJxCv1mqYYy/aH9hRUpOLFjDmABakxYfkSnJqz5nry2Fr JbT3SUQDaiFVorsZgT479gid+C65Ur/EDtI3MbgNyWbfoz/3aRIKoIbNUn61YPURnJWT lNMLUOMVJ0zWgbzFzH70bgIbPsmR8l8TyyrWhkszyhR8KLaOpClXSNjEumzVhO6Ymy9J dLxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VvXbLXIg; dkim=pass header.i=@codeaurora.org header.s=default header.b=VvXbLXIg; 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 w68-v6si14930256pfw.308.2018.08.26.23.57.41; Sun, 26 Aug 2018 23:57:57 -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=@codeaurora.org header.s=default header.b=VvXbLXIg; dkim=pass header.i=@codeaurora.org header.s=default header.b=VvXbLXIg; 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 S1727065AbeH0Kl5 (ORCPT + 99 others); Mon, 27 Aug 2018 06:41:57 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39220 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbeH0Kl5 (ORCPT ); Mon, 27 Aug 2018 06:41:57 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BBB8160241; Mon, 27 Aug 2018 06:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1535352997; bh=Q3K6GjTnFMoCzhIVMZa3f5obK+2n76xcgfCLmGrt2OQ=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=VvXbLXIgzk8STg4F3/ziy628ThcSs8YJfmPqGZSoFjL6wZ6U7kqnFz6xfdtUOHUjT pVBfjyixMS6fmx2Rnf4zp4afPSOnNMdu0e6KElrLsb9OkVTfRRGee7EMLicJtVqexg L6jBFgnlOQ6X0GfM4dCjpAEovQatScbPCTIkLMjM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.79.20] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gkohli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4B48F60241; Mon, 27 Aug 2018 06:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1535352997; bh=Q3K6GjTnFMoCzhIVMZa3f5obK+2n76xcgfCLmGrt2OQ=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=VvXbLXIgzk8STg4F3/ziy628ThcSs8YJfmPqGZSoFjL6wZ6U7kqnFz6xfdtUOHUjT pVBfjyixMS6fmx2Rnf4zp4afPSOnNMdu0e6KElrLsb9OkVTfRRGee7EMLicJtVqexg L6jBFgnlOQ6X0GfM4dCjpAEovQatScbPCTIkLMjM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4B48F60241 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=gkohli@codeaurora.org Subject: Re: [PATCH] percpu_counter: Remove debug_object_free call twice From: "Kohli, Gaurav" To: Tejun Heo Cc: gregkh@linuxfoundation.org, nborisov@suse.com, akpm@linux-foundation.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1523612103-15071-1-git-send-email-gkohli@codeaurora.org> <20180416214810.GF1911913@devbig577.frc2.facebook.com> Message-ID: <5703acbf-da53-7409-7d73-f48e580ce1cd@codeaurora.org> Date: Mon, 27 Aug 2018 12:26:32 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi , Sorry for very late reminder, just wanted to know is below understanding of code is wrong? Regards Gaurav On 4/17/2018 11:59 AM, Kohli, Gaurav wrote: > On 4/17/2018 3:18 AM, Tejun Heo wrote: > >> On Fri, Apr 13, 2018 at 03:05:03PM +0530, Gaurav Kohli wrote: >>> During percpu_counter destroy, debug_object_free is calling >>> twice which may create race. So removing once instance of call >>> from debug_percpu_counter_deactivate. >> I don't quite follow.  Can you please elaborate how it can be called >> twice? > > Hi Tejun, > > In percpu_counter_fixup_free function, first call is > percpu_counter_destroy -> debug_percpu_counter_deactivate (this will set > inactive and free the debug object as well for percpu counter) -> > free_percpu (finally freeing the counters). > > Below is the code snippet: > >         case DEBUG_STATE_ACTIVE: > >                 percpu_counter_destroy(fbc); -> first call > >                 debug_object_free(fbc, &percpu_counter_debug_descr); -> > this will again call the same debug object free, if somehow counters > will reinitialize between these two calls. > > > We are seeing one race condition issue where one object of db list is > corrupted and just before object of that corrupted node is > percpu_counter, Still i am not sure the reason of race as it is very > > difficult to reproduce. But i have found this during code review. Please > correct me, if i misunderstood this. > >> >> Thanks. >> >> -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.