Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4511124imm; Wed, 30 May 2018 07:02:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIi+qZnUozuPH2hkbLKWqt+aNShj9LD2tNyaSAd/hJ1dmiOJ047fnKq6XTTzg7ZGLir9sOW X-Received: by 2002:a62:4fd8:: with SMTP id f85-v6mr2927474pfj.77.1527688946289; Wed, 30 May 2018 07:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527688946; cv=none; d=google.com; s=arc-20160816; b=mNM+fxhJSoaRAkw5JYrfTaf9Wxfr/QZswv1ZQYQguaD9WlYRBHww0jsdgCeV7s4ubU 4rk9xwZNDMlC6BuVQowpsLftO37cfXefikV2ZDYfO8JrEziNYZ/POXO4kicUL1u3Fvy6 OgGz6CdfCSdzTFI/yOaQfShlteGk86j2IbBZI3hv+qGVgYsCaoeLjizCzDJFz94pMi2l Ct35ASVh/XVqLvJZlGijiCc+rwxBKztuH3eaGlytCxTdBNaesk5A5LVNjfJ/EnBXGbkg HhhCJG2zGI0XQY9YYerfBlWD+MMzuzRN8Sgq6OHMQ/YBXVE701GXR/cavX4FSd2MT15R EDPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=6o4B/aKiSCT++xp+skqVtpMW8FA3FCDUvV6yv1CbUd0=; b=RVDpIOxsAJfCMPQpqPGAyXy2L5FGy1UPoY9EC/PnEJeP6D1L9hgRCWBN6yJsdFiizg BPZ9mcSTN0JeZQ3M9Qb6LVDqMA9vkSNHfFA2y7Myql27lWkU9HpIjmQKsM6gA4Tdev5f HnP4X0T9S7dPZ5KN3ETqFfAhe10W3e3Ockf3zleb7i4wDcfcFbNou1RrL6pl6/nfUXkd BcEj+5kcNOv1bPosVSXAMTJHOl1FUhmhyptcvTdY/dNykwJsUj2jMruacVu1LmRaCxPl 8Xs3T0i73qS/RWqTHgB5jNeKZCMMjCSBaFGtOnCa9geUGeKU6VgD+hmYGEA5SvtVFnZy IG7A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13-v6si27599064pgu.237.2018.05.30.07.02.10; Wed, 30 May 2018 07:02:26 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784AbeE3OAc (ORCPT + 99 others); Wed, 30 May 2018 10:00:32 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:40973 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbeE3OAa (ORCPT ); Wed, 30 May 2018 10:00:30 -0400 Received: by mail-wr0-f193.google.com with SMTP id u12-v6so29627286wrn.8 for ; Wed, 30 May 2018 07:00:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6o4B/aKiSCT++xp+skqVtpMW8FA3FCDUvV6yv1CbUd0=; b=PLrY3T47Q2D5OqQ6G2+8rKYqMeNjKHw2HJl6knMxMt4/ot8ByeWYDoh0wVn26L8xl0 0Sik6XsAiFz3qcJpJLuxLf7VF8uP90B6yj9+t5QnKD5A98lFs0w4XD3Nag0dOJy1gdLP MOBoMkvsisoZK/2EbI8hvGCDPZAytf2FOb8Qyi7n7hcG1iHSB/9MGtybrjdozMUKbtWF ehkXiPPgFPIwQ15SZw9Cx/itERxTNU59+wAOU7WukJGnSvaJ/U4inMCtqwqjuywcH7lz +MiJubFAcAAzY9E1rJDemLM6UpB/+3uxym67aj9XuFxh9py6Kj2t4cv0GRN1y7Um8+Ue jJJw== X-Gm-Message-State: ALKqPwe1Z6DDlnIxP93BL/L8xq9YQjhwDp/Po3S1B59Vfmgi04Q+iwD8 3MX3FfNzMMP0nBkXeKGy53QtRg== X-Received: by 2002:adf:e20b:: with SMTP id j11-v6mr2273032wri.205.1527688829638; Wed, 30 May 2018 07:00:29 -0700 (PDT) Received: from localhost.localdomain ([151.15.207.242]) by smtp.gmail.com with ESMTPSA id a14-v6sm48953214wra.84.2018.05.30.07.00.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 May 2018 07:00:29 -0700 (PDT) Date: Wed, 30 May 2018 16:00:21 +0200 From: Juri Lelli To: Waiman Long Cc: Tejun Heo , Li Zefan , Johannes Weiner , Peter Zijlstra , Ingo Molnar , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kernel-team@fb.com, pjt@google.com, luto@amacapital.net, Mike Galbraith , torvalds@linux-foundation.org, Roman Gushchin , Patrick Bellasi Subject: Re: [PATCH] cpuset: Enforce that a child's cpus must be a subset of the parent Message-ID: <20180530140021.GF3320@localhost.localdomain> References: <1527687991-1431-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527687991-1431-1-git-send-email-longman@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 30/05/18 09:46, Waiman Long wrote: > It was found that the cpuset.cpus could contain CPUs that are not listed > in their parent's cpu list as shown by the command sequence below: > > # echo "+cpuset" >cgroup.subtree_control > # mkdir g1 > # echo 0-5 >g1/cpuset.cpus > # mkdir g1/g11 > # echo "+cpuset" > g1/cgroup.subtree_control > # echo 6-11 >g1/g11/cpuset.cpus > # grep -R . g1 | grep "\.cpus" > g1/cpuset.cpus:0-5 > g1/cpuset.cpus.effective:0-5 > g1/g11/cpuset.cpus:6-11 > g1/g11/cpuset.cpus.effective:0-5 > > As the intersection of g11's cpus and that of g1 is empty, the effective > cpus of g11 is just that of g1. The check in update_cpumask() is now > corrected to make sure that cpus in a child cpus must be a subset of > its parent's cpus. The error "write error: Invalid argument" will now > be reported in the above case. > > Reported-by: Juri Lelli > Signed-off-by: Waiman Long Looks like it fixes the bug. Reviewed-and-Tested-by: Juri Lelli Thanks, - Juri