From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755102AbcEWPyW (ORCPT ); Mon, 23 May 2016 11:54:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:49394 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752876AbcEWPyU (ORCPT ); Mon, 23 May 2016 11:54:20 -0400 From: Petr Mladek To: jpoimboe@redhat.com, mbenes@suse.cz, jeyu@redhat.com, jikos@kernel.org, jslaby@suse.cz Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, huawei.libin@huawei.com, minfei.huang@yahoo.com, Petr Mladek Subject: [RFC PATCH 0/2] livepatch: Avoid possible race when releasing the patch Date: Mon, 23 May 2016 17:54:06 +0200 Message-Id: <1464018848-4303-1-git-send-email-pmladek@suse.com> X-Mailer: git-send-email 1.8.5.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There was a long discussion about a possible race with sysfs, kobjects when removing an unused livepatch, see https://lkml.kernel.org/g/%3C1462190242-24731-1-git-send-email-mbenes@suse.cz%3E This patch set tries to implement what looked the most preferred solution from the discussion. I did my best to keep the patch definition simple. But I am not super happy with the result. I send the current state before I spent even more time on different approaches. I personally think that we might get better result if we declare some limited structures, define them statically and then copy all data into the final structures in a single call. I did not implement this because it was weird on the first look but I am not sure now. But even more I would prefer the solution with the completion. It is already used by the module framework. It does not look that hacky to me after all. See the comments in the second patch for more details. This patch set has been tested against linux-next. Petr Mladek (2): livepatch: Extend the livepatch-sample patch livepatch: Use kobjects the right way include/linux/livepatch.h | 70 +++++-- kernel/livepatch/core.c | 355 +++++++++++++++++++++++------------ samples/livepatch/livepatch-sample.c | 159 +++++++++++++--- 3 files changed, 425 insertions(+), 159 deletions(-) -- 1.8.5.6