Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4279192imu; Mon, 28 Jan 2019 21:48:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN6PpOWEamtj7xPvYc0empBWgt0e8HX1y8S8r7ItSY/XALhBTw5XOBIudTSj64fjKQh2pwBe X-Received: by 2002:a62:7c47:: with SMTP id x68mr24984687pfc.209.1548740936922; Mon, 28 Jan 2019 21:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548740936; cv=none; d=google.com; s=arc-20160816; b=t6R2cqqlJ86rgp09NM2DiV2naf1k9yO9m+lxsqwC1vm5o3fED419/SHWdYU18fiSi0 slzdjt8UD7Tq+QwNONcezQy+pzFNQKyaRAyT03Aq5jF64l2KMXJVi2csS9XqXztmRI9V YgudcvIPEW4spJERMCdHvC2smy54probSVqt0nQhXVKR2JlN0ReRyrGjR8PPIwUEnQh7 zNkuUeee7gQGnE+MEsuSnoz7lAf74qVlb5RhKW7sxBEtAVJDlJzVIpdPg5xThS8nx2tl ZKXdiOmlgaOMEvRFuHx5Sj9Vfab6Ac3wnxNM84JKNVb7DxPBRVUQ9uAECfmiCljD5xSG Fw1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=bB1FCkNUdswjLFqFVeg1iGIzwpsiuISE6MtB5gKVSTY=; b=mHaUdCbEFRsCMefsTaKI++saKRBs8r4hfOb47B4UcMWPJxCCnRlyhqbCCk+Rp8AnKq aCEoaZDezz0Ho0SyyC6VdFVO+bjmulcbpwO7VX+19ImSZTgQgKvlUY+U/d4MT65J/a55 U2BF+1HAMfJ+YbheIWcQ9lI4wxgDWk0aAqOzWFEr/D3s3vJHhtNwvGr13cMu8CLBLkZF f/aX0QfnrHkyN4bjFyEY/UvbfDaIH/V0vfMQRyCisF0fw8QpTR5cMNXDN1j9AesuonzZ LZ7le5EHNcMaHRZdryZS/1nrd9fEVy1pBBXFLPi8arrYj1esQF8JyDt6URN5Igd1/PKF cAJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=KWDKmtCf; 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 u22si3390807pgk.335.2019.01.28.21.48.41; Mon, 28 Jan 2019 21:48:56 -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; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=KWDKmtCf; 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 S1726462AbfA2Fqf (ORCPT + 99 others); Tue, 29 Jan 2019 00:46:35 -0500 Received: from a9-37.smtp-out.amazonses.com ([54.240.9.37]:47034 "EHLO a9-37.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbfA2Fqf (ORCPT ); Tue, 29 Jan 2019 00:46:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1548740794; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=bB1FCkNUdswjLFqFVeg1iGIzwpsiuISE6MtB5gKVSTY=; b=KWDKmtCftgtgM2ZJcqVw4AL9rYmnXIGiC3KihZlVuwymWamuVEOrIzQAWGDPCMyK v01J/DJUit96069vJpL7d1G4EeFObs09La7bxos9AZ1B9iRWw9JK3IJFv9xYB6pC//f 8F7sWarq8ACrydMAfd5INljkzut40byhQoc4/ZPM= Date: Tue, 29 Jan 2019 05:46:34 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Andrew Morton cc: miles.chen@mediatek.com, Pekka Enberg , David Rientjes , Joonsoo Kim , Jonathan Corbet , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v2] mm/slub: introduce SLAB_WARN_ON_ERROR In-Reply-To: <20190128122954.949c2e6699d6e5ef060a325c@linux-foundation.org> Message-ID: <0100016898251824-359bbfae-e32b-43a6-8c58-8811a7b24520-000000@email.amazonses.com> References: <1548313223-17114-1-git-send-email-miles.chen@mediatek.com> <20190128122954.949c2e6699d6e5ef060a325c@linux-foundation.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.01.29-54.240.9.37 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Jan 2019, Andrew Morton wrote: > > When debugging slab errors in slub.c, sometimes we have to trigger > > a panic in order to get the coredump file. Add a debug option > > SLAB_WARN_ON_ERROR to toggle WARN_ON() when the option is set. > > > > Change since v1: > > 1. Add a special debug option SLAB_WARN_ON_ERROR and toggle WARN_ON() > > if it is set. > > 2. SLAB_WARN_ON_ERROR can be set by kernel parameter slub_debug. > > > > Hopefully the slab developers will have an opinion on this. Debugging slab itself is usually done in kvm or some other virtualized environment. Then gdb can be used to set breakpoints. Otherwise one may add printks and stuff to the allocators to figure out more or use perf. What you are changing here is the debugging for data corruption within objects managed by slub or the metadata. Slub currently outputs extensive data about the metadata corruption (typically caused by a user of slab allocation) which should allow you to set a proper breakpoint not in the allocator but in the subsystem where the corruption occurs.