Received: by 10.192.165.148 with SMTP id m20csp4127617imm; Mon, 30 Apr 2018 12:13:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWMX0QOH4adOu3Yr+C56t22SCgW4yQ87qFjuiDgW1x04+Qd1IadAjkF6LzxsS5Mjymz2/5 X-Received: by 2002:a17:902:1744:: with SMTP id i62-v6mr13651349pli.267.1525115626273; Mon, 30 Apr 2018 12:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525115626; cv=none; d=google.com; s=arc-20160816; b=Zkk8U49B/a/jmfjinEMbtYJGJ25oY3ECRrirdoMwhcq1PT8/ZK/mz5NTTPKaJ7m4JY 4xxWIS9K7oJCTDTGDXA94duE23EkE5pdDtU1+rsjtM3BI81IF/F8hVujgRurWFTbtrSN fmppLG0ETzNJ6YUV/C3jqdBF31uFKEa0XBGMEpqzUhNVRuSjxF68XUXxeOzyO0ZRNgF9 UpTvmagFRWtIVaXdKr5ONKVBGQSYx9gVwPF1StoohTgRWFLh9cdY/ojvtR2lqDRNtQzj dwBJeEnKqSNoBih2/Gg2WlhMCQhR82RMya4fQiFm+rdgKyKiLaZJX3nsemqrusGnK6xT x9Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=aVlEsfvNiFtMg8JnjbguDNoUYAuozjMrDJ8nI0iGA1A=; b=b0CWBvX9LpSE7Qp1Zu1rhEHPqfS6DM/QCi1N/hzsnLCf2DyiJuQUfqOkIu6OnSpN++ wfFWk0SogLExbwtzY9+FXERQ4hoMgT23YKt6DXq9lCqKl/ETDgaYIviXsjBOZi14nQMG /3hIAIgXw6yUSWKpeMwgXXV9cIkolBp0Mc9/69uKaLPCi6ya9jTdRPI3RW22yYASCv4Q Bajy1CjUKiQwU8f1qXjW6fZGeA4MnztwOqy+LRb0VGjCBQjndAfolnykqSvlZ1IJNrTW FItHHP9owTJMBrKgGUeAvg3jhuwD8eIZyDb/tU46XleMAdch/vgM/ZOOHb7BaWH+gP3A JQ7g== 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 bi1-v6si3259881plb.267.2018.04.30.12.13.32; Mon, 30 Apr 2018 12:13:46 -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 S1754504AbeD3TML (ORCPT + 99 others); Mon, 30 Apr 2018 15:12:11 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:20833 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753877AbeD3TMK (ORCPT ); Mon, 30 Apr 2018 15:12:10 -0400 X-IronPort-AV: E=Sophos;i="5.49,348,1520895600"; d="scan'208";a="325166180" Received: from 85-171-61-52.rev.numericable.fr (HELO [192.168.0.15]) ([85.171.61.52]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2018 21:12:08 +0200 Date: Mon, 30 Apr 2018 21:12:08 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sasha Levin cc: Greg KH , "linux-kernel@vger.kernel.org" Subject: Re: bug-introducing patches (or: -rc cycles suck) In-Reply-To: <20180430175829.GB1544@sasha-vm> Message-ID: References: <20180430175829.GB1544@sasha-vm> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Apr 2018, Sasha Levin wrote: > Working on AUTOSEL, it became even more obvious to me how difficult it is for a patch to get a proper review. Maintainers found it difficult to keep up with the upstream work for their subsystem, and reviewing additional -stable patches put even more load on them which some suggested would be more than what they can handle. > > While AUTOSEL tries to understand if a patch fixes a bug, this was a bit late: the bug was already introduced, folks already have to deal with it, and the kernel is broken. I was wondering if I can do a similar process to AUTOSEL, but teach the AI about bug-introducing patches. > > When someone fixes a bug, he would describe the patch differently than he would if he was writing a new feature. This lets AUTOSEL build on different commit message constructs, among various inputs, to recognize bug fixes. However, people are unaware that they introduce a bug, so the commit message for bug introducing patches is essentially the same as for commits that don't introduce a bug. This meant that I had to try and source data out of different sources. > > Few of the parameters I ended up using are: > - -next data (days spent in -next, changes in the patch between -next trees, ...) > - Mailing list data (was this patch ever sent to a ML? How long before it was merged? How many replies did it get? ...) > - Author/commiter/maintainer chain data. Just like sports, some folks are more likely to produce better results than others. This goes beyond just "skill", but also looks at things such as whether the author patches a subsystem he's "familiar with" (== subsystem where most of his patches usually go), or is he modifying a subsystem he never sent a patch for. > - Patch complexity metrics - various code metrics to indicate how "complex" a patch is. Think 100 lines of whitespace fixes vs 100 lines that significantly changes a subsystem. > - Kernel process correctness - I tried using "violations" of the kernel process (patch formatting, correctness of the mailing to lkml, etc) as an indicator of how familiar the author is with the kernel, with the presumption that folks who are newer to kernel development are more likely to introduce bugs I'm not completely sure to understand what you are doing. Is there also some connection to things that are identified in some way as being bug introducing patches? Or are you just using these as metrics of low quality? I wonder how far one could get by just collecting the set of patches that are referenced with fixes tags by stable patches, and then using machine learning taking into account only the code to find other patches that make similar changes. julia > Running an initial iteration on a set of commits made two things very obvious to me: > > 1. -rc releases suck. seriously suck. The quality of commits that went in -rc cycles was much worse that merge window commit: > - All commits had the same chance of introducing a bug whether they came in a merge window or an -rc cycle. This means that -rc commits mostly end up replacing obvious bugs with less obvious ones. > - While the average merge window commit changes, on average, 3x more lines than an -rc commit, the chances of a bug introduced per patch is the same, which means that bugs-per-line metric of code is much higher with -rc patches. > - A merge window commit spent 50% more days, on average, in -next than a -rc commit. > - The number of -rc commits that never saw any mailing list or has never been replied to on a mailing list was **way** higher than merge window commits. > - For some reason, the odds of a -rc commit to be targetted for -stable is over 20%, while for merge window commits it's about 3%. I can't quite explain why that happens, but this would suggest that -rc commits end up hurting -stable pretty badly. > > 2. Maintainers need to stop writing patches, commiting them, and pushing them in without reviews. > In -rc cycles there is quite a large number of commits that were either written by maintainers, commited, and merged upstream the same day. These patches are very likely to introduce a new bug. > > > I don't really have a proposal beyond "tighten up -rc cycles", but I think it's a discussion worth having. We have enough data to show what parts of kernel development work, and what parts are just hurting us.